c# - 运行时错误 : Could not load file or assembly 'Microsoft. Owin,版本=3.0.0.0....Azure 移动服务

标签 c# .net azure owin azure-mobile-services

创建移动服务后,我已从 Azure managementprotal 下载了 ToDOService 项目。最初它有很多错误,因为 Nuget 包已经过时了。我卸载了 Azure 移动服务 .net 后端 包及其依赖项。后来我再次手动安装了所有软件包,然后我就可以成功构建项目了。不知何故,当我运行服务项目时,我收到此错误:-

Could not load file or assembly 'Microsoft.Owin, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Owin, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Source Error: 


Line 18: 
Line 19:             // Use this class to set WebAPI configuration options
Line 20:             HttpConfiguration config = ServiceConfig.Initialize(new ConfigBuilder(options));
Line 21: 
Line 22:             // To display errors in the browser during development, uncomment the following

Source File: ...\MyProject\MyService\App_Start\WebApiConfig.cs    Line: 20

我的 web.config 看起来像这样

<dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly> 

我也尝试将程序集更新到最新,但无法更新,因为版本 3.0.1 与其其他依赖项不兼容。

如有任何帮助,我们将不胜感激。谢谢

最佳答案

我也遇到过这个问题,this blog post说当 SignalR 或 Web API 应用程序以辅助角色运行时,就会发生这种情况。对我来说,这个错误发生在我运行一个作为我的解决方案一部分的控制台应用程序之后...下次我尝试访问使用 Web API 的项目中的 Web 应用程序时,我会看到蓝屏死机。

博客文章中提到的修复不起作用,看来您的 web.config 指定了正确的版本信息。听起来这仍然是 NuGet 包的问题。

关于c# - 运行时错误 : Could not load file or assembly 'Microsoft. Owin,版本=3.0.0.0....Azure 移动服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29739501/

相关文章:

c# - 在 C# 函数中生成 Linq 查询

c# - 用 LINQ 合并两个 IEnumerable

.net - 无法使用 HttpRequest 创建 SSL/TLS 安全通道

azure - 查找未使用的存储帐户 azure ARM

c# - 在 ReSharper 中禁用 C# 6.0 支持

c# - new Task 总是在 ThreadPool 线程上执行吗?

azure - 通过元数据查询对象存储中的图像

azure - 如何通过调用 api 设置 Key Vault key 的过期日期

c# - 建议的组合框下拉宽度

.net - 如何减少花费在 GC 上的时间