简体   繁体   English

天蓝色的移动服务中有冲突的System.Web.Http.Cors程序集

[英]Conflicting System.Web.Http.Cors assembly in azure mobile services

Suddenly I got the following error when publishing to Azure Mobile Services. 发布到Azure移动服务时突然出现以下错误。

"Error Found conflicts between different versions of the same dependent assembly 'System.Web.Http.Cors': 5.1.0.0, 5.2.2.0. Please change your project to use only one version. App.Hosting 2014-09-20 23:40:26" “同一从属程序集'System.Web.Http.Cors'的不同版本之间发现错误冲突:5.1.0.0,5.2.2.0。请更改项目以仅使用一个版本。App.Hosting 2014-09-20 23: 40:26“

I use Microsoft.AspNet.WebApi.Cors and WindowsAzure.MobileServices.Backend (1.0.348). 我使用Microsoft.AspNet.WebApi.Cors和WindowsAzure.MobileServices.Backend(1.0.348)。

I have tried going through all references and I cant find any pointing at 5.2.2.0. 我尝试遍历所有引用,但找不到指向5.2.2.0的任何指向。 I have also tried upgrading to 5.2.2.0 however when doing so I get: "Error Boot strapping failed: executing 'WebApiConfig.Register' caused an exception: 'Could not load file or assembly 'System.Web.Http.Cors, Version=5.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.'. App.Hosting 2014-09-20 23:06:20" 我也曾尝试升级到5.2.2.0,但是这样做时我得到:“错误引导捆绑失败:执行'WebApiConfig.Register'导致异常:'无法加载文件或程序集'System.Web.Http.Cors,版本= 5.1.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'或其依赖项之一。系统找不到指定的文件。'。App.Hosting 2014-09-20 23:06:20“

I can not understand why I get this error and it seem to have start to occur with no apparent reason. 我不明白为什么会收到此错误,并且似乎已经开始发生,没有明显的原因。

Any pointer is appreciated. 任何指针表示赞赏。

We are in the process of updating to the newly released ASP.NET Web API 5.2 and it looks like we missed an assembly redirect for the CORS assembly. 我们正在更新到最新发布的ASP.NET Web API 5.2,看来我们错过了CORS程序集的程序集重定向。

In a couple of days you will be able to use the full ASP.NET Web API 5.2 but the upgrade has to complete first. 在几天之内,您将可以使用完整的ASP.NET Web API 5.2,但升级必须首先完成。 To fix your problem now, you should be able to just remove your own CORS assembly (assuming you are only setting the origins) and then set them using the MS_CrossDomainOrigins app setting in your local web.config as described in this blog [1], for example: 现在要解决您的问题,您应该能够删除自己的CORS程序集(假设您仅设置原点),然后使用本地web.config中的MS_CrossDomainOrigins应用程序设置进行设置,如本博客所述[1],例如:

<add key="MS_CrossDomainOrigins" value="http://testhost, http://sample" />

Sorry for the inconvenience! 抱歉给你带来不便!

Henrik 亨里克

[1] http://azure.microsoft.com/blog/2014/07/28/azure-mobile-services-net-updates/ [1] http://azure.microsoft.com/blog/2014/07/28/azure-mobile-services-net-updates/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure移动服务Web Api上的SignalR CORS - SignalR CORS on Azure Mobile Services Web Api 在Azure移动服务中启用CORS-未授权的选项 - Enable CORS in Azure Mobile Services - OPTIONS not authorized Azure webrole循环和“无法加载文件或程序集System.Web.Http 5.2.0.0” - Azure webrole cycling and “Could not load file or assembly System.Web.Http 5.2.0.0” Azure移动服务和Web API身份验证 - Azure Mobile Services and Web API authentication 天蓝色错误部署无法解析此参考。 无法找到程序集System.Web.Http,版本= 4.0.0.0 - Deploying in azure error Could not resolve this reference. Could not locate the assembly System.Web.Http, Version=4.0.0.0 无法加载文件或程序集“ System.Web.Services” - Could not load file or assembly 'System.Web.Services' 调用 Microsoft.Owin.Cors 后无法加载 System.Web.Cors 程序集 - Can't load System.Web.Cors assembly after call to Microsoft.Owin.Cors 无法加载文件或程序集 'System.Web.Services,版本 = 4.0.0.0 - Could not load file or assembly 'System.Web.Services, Version=4.0.0.0 Web API和MVC中的Azure移动服务令牌验证 - Azure Mobile Services token validation in Web API and MVC 我应该使用Azure移动服务还是坚持使用Web Api - Should I use Azure Mobile Services or stick with Web Api
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM