我已安装 Microsoft.AspNet.WebApi.Cors
包装使用 Install-Package Microsoft.AspNet.WebApi.Cors
在我的 WebApi 项目(.net framework 4.5.2)中,现在我在编译项目时遇到以下错误。
引用:http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api
Assembly 'System.Web.Http.Cors, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' uses 'System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Http, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
最佳答案
您需要为此安装以下 nuget 包。
安装包 Microsoft.AspNet.WebApi.Cors.ko -Version 5.0.0
这将起作用。
关于.net - 在 Web API 中获取 Microsoft.AspNet.WebApi.Cors 版本问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29031973/