为什么在调试模式下启动时是MVC网页API只访问? [英] Why is MVC Web Api only reachable when started in debug mode?
问题描述
我现在面临两个我的笔记本电脑和台式电脑一个奇怪的问题。
I am facing a strange problem on both my laptop and desktop computer.
在我的解决方案我有一个MVC 4个Web API和解决方案是由Visual Studio 2013年开始搜索
因此,如果设置Web API项目作为启动项目,然后当我键入网页API的一些URL它击中控制器。
In my solution I have an MVC 4 Web Api and the solution is started by Visual Studio 2013.
So If set the Web API project as startup project then When I type some url of the web api it hits the controller.
但如果启动文件夹是另一个项目,就像一个网站,这个消耗API网站,那么Web API只是无法访问。
But if the startup folder is another project, like a website that consumes this web api, then the web api is just unreachable.
我甚至尝试打时,网页API在调试模式下启动,工程相同的URL。
I even tried to hit the same url that works when web api is started in debug mode.
那么,什么地方出错了?
So, what could be wrong?
推荐答案
我发现的实际问题。
我运行Windows 7 64位和Visual Studio 2013。
我不得不取消选中启用编辑,并在工具 - >选项 - >调试继续复选框。
I have found the actual problem. I am running Windows 7 x64 and Visual Studio 2013. I had to uncheck the Enable Edit and Continue checkbox under Tools->Options->Debugging.
现在,我在我的解决方案使用单一的启动项目,我也可以调用Web API时,没有在调试模式下。
Now I am using a single startup project in my solution and I can call the web api also when not in Debug mode.
这篇关于为什么在调试模式下启动时是MVC网页API只访问?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!