The type initializer for 'System.Web.Http.GlobalConfiguration' threw an exception

前端 未结 3 489
花落未央
花落未央 2021-01-30 12:54

I have added a new Web API project. I install Cors

PM> Install-Package Microsoft.AspNet.WebApi.Cors -Pre

Then when I run my project, I get t

3条回答
  •  既然无缘
    2021-01-30 13:09

    I had the same problem. Definitely "Cors" doesn't work to me!

    What I did to solve my problem with Cross Domain in WebApi it was remove Cors and change my web.config

    If you insert the following lines inside your web.config, you'll have an WebApi with Cross Domain enabled.

提交回复
热议问题