无法加载文件或程序集'RestSharp,Version = 105.2.3.0

Thu*_*gge 9 c# asp.net iis twilio nuget

我在理解这个问题时遇到了一些麻烦.

通过Nuget添加Twilio的本地项目.但是当我将项目导出到我的IIS服务器时,即使我已经为Twilio添加了所有DLL文件,它也无法使用Twilio.

我想我错过了包含或东西的东西..

这是我得到的错误消息:

Exception information: 
    Exception type: FileNotFoundException 
    Exception message: Could not load file or assembly 'RestSharp, Version=105.2.3.0, 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()
Run Code Online (Sandbox Code Playgroud)

KAI*_*KAI 8

添加引用时RestSharp,请注意版本号(版本= 105.2.3.0).

此外,您的项目的.net框架应该高于或等于引用的dll.


Xav*_*eña 8

我有同样的问题,我终于找到了如何解决它.

问题是:当您Twilio通过NuGet 安装时,它将RestSharp作为依赖项安装.但由于某种原因,安装的版本RestSharpVersion=105.2.2.0(而不是Version=105.2.3.0,Twilio似乎在运行时寻找).

那么你如何解决这个问题呢?

  1. 转到已安装的NuGet包
  2. 选择 RestSharp
  3. 将其更新到版本105.2.3.0(带蓝色箭头图标)

为什么NuGet Twilio软件包安装RestSharp Version=105.2.2.0然后在运行时查找RestSharp Version=105.2.3.0?不知道.


小智 6

  1. 删除 Restsharp 的所有引用。

  2. 清洁溶液(清洁溶液选项)

  3. 添加 RestSharpSigned.105.2.3(按名称 RestSharpSigned 查找)。

    是工作。