Thugge Thugge - 1 year ago 554
ASP.NET (C#) Question

Could not load file or assembly 'RestSharp, Version=

I am having some trouble understanding this issue.

I have a local project with Twilio added via Nuget. But when I export the project to my IIS server, it cannot use Twilio, even if i have added all the DLL files for Twilio.

I think I am missing something with the include or something..

This is the errormessage i get:

Exception information:
Exception type: FileNotFoundException
Exception message: Could not load file or assembly 'RestSharp, Version=, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
at Twilio.TwilioClient..ctor(String accountSid, String authToken, String accountResourceSid, String apiVersion, String baseUrl)
at Twilio.TwilioRestClient..ctor(String accountSid, String authToken, String accountResourceSid) in C:\projects\twilio-csharp\src\Twilio.Api\Core.cs:line 182
at Modules.Messaging.TwilioClient.Send()

Answer Source

When you are adding a reference to RestSharp, be aware of the version number (Version=

Also, your project's .net framework should be higher or equal then the referenced dll's.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download