Referencing system.web.cors

前端 未结 4 1646
梦毁少年i
梦毁少年i 2021-02-06 23:42

I\'m trying to implement cors support in my Web API.

I have read a couple of blog posts on this topic, but I can\'t seem to find System.Web.Cors.dll or System.Web.Http.C

相关标签:
4条回答
  • 2021-02-06 23:50

    According to this thread, you can get it using nightly builds of ASP.NET using nuget (see instructions here). But it sounds like it is only compatible with v5 of System.Web.Http so you'll potentially need to get that also. That is certainly not RTM so you'd have to be comfortable with that.

    0 讨论(0)
  • 2021-02-07 00:01

    The System.Web.Cors assembly is now available on NuGet in the Microsoft.AspNet.Cors package. This is currently a prerelease package, so if you're using the Visual Studio package manager, you'll need to include prerelease packages.

    0 讨论(0)
  • 2021-02-07 00:02

    The only way to use System.Web.Cors locally is to use the nightly builds as per this discussion. http://aspnetwebstack.codeplex.com/discussions/436442

    0 讨论(0)
  • 2021-02-07 00:10

    Create a .NET 4.5 MVC project, install nuget package "Microsoft ASP.NET Web API [version] Cross-Origin Support" (search for "cors" and it will be on 1st or 2nd place in list). That's it.

    P.S. If you encounter errors try to install "Microsoft ASP.NET Web API [version]" package too (search for "WebApi").

    0 讨论(0)
提交回复
热议问题