本文介绍了对于“System.Web.Http.GlobalConfiguration'的类型初始值引发了异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我添加了一个新的Web API项目。我安装一个Cors
PM>安装封装Microsoft.AspNet.WebApi.Cors - pre
后来,当我跑我的项目,我得到这个错误:
This is my inner exception:
解决方案
I came across the same issue and found a blog post on it. According to this blog post if you use the release candidate it should fix the error
Install-Package Microsoft.AspNet.WebApi -IncludePrerelease
From here: http://wp.sjkp.dk/webapi-and-cors-enabled-rest-services/
This worked for me :D
In other words, it was fixed in 5.1.0-rc1
release.
这篇关于对于“System.Web.Http.GlobalConfiguration'的类型初始值引发了异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!