的WebAPI的{"消息":"发生与QUOT一个错误;} IIS7上,而不是在IIS防爆preSS
我与ASP.NET MVC 4的WebAPI工作,我有很多的乐趣与它运行它在IIS防爆preSS我的本地计算机上。我已经配置了IIS防爆preSS服务远程机器过了,在我的公司,所以其他的都在使用我的电脑作为我们的网络服务器。
I'm working with ASP.NET MVC 4 WebApi and am having a lot of fun with it running it on my local computer on IIS Express. I've configured IIS Express to serve remote machines too, and so other's in my company are using my computer as our webserver.
决定,这是一个低于最佳的解决方案后,我们决定把的WebAPI的远程服务器上安装.NET 4.5之后。当我使用小提琴手和发送POST到控制器我的本地机器上它返回正确的响应,但是当我改变运行IIS7域到web服务器相同的POST返回一个神秘的
After deciding this was a less-than-optimal solution, we decided to put the WebApi on a remote server after installing .NET 4.5. When I use fiddler and sent a POST to a controller on my local machine it returns the correct response, yet when I change the domain to the webserver running IIS7 the same POST returns a cryptic
{消息:发生的错误}
{"message":"an error has occurred"}
信息。任何人有任何想法可能是什么回事?
message. Anyone have any idea what could be going on?
的问题是缺少的依赖,这不是在服务器上,但是是我的本地机器上。就我们而言,这是一个Devart.Data.Linq DLL。
The problem was a missing dependency that wasn't on the server but was on my local machine. In our case, it was a Devart.Data.Linq dll.
要得到这个问题的答案,我打开IIS跟踪500错误。这给了一点点信息,但真正有用的东西是在web.config中设置<&的System.Web GT;<的customErrors模式=关/>< /system.web> ;
此指出,缺少动态加载的依赖。增加这种依赖,并告诉它在本地复制完毕后,服务器开始工作。
To get to that answer, I turned on IIS tracing for 500 errors. That gave a little bit of information, but the really helpful thing was in the web.config setting the <system.web><customErrors mode="Off"/></system.web>
This pointed to a missing dynamically-loaded dependency. After adding this dependency and telling it to be copied locally, the server started working.