HttpApplication.Application_Start不烧成后升级到网页API 2 [英] HttpApplication.Application_Start not firing after upgrade to Web API 2

查看:109
本文介绍了HttpApplication.Application_Start不烧成后升级到网页API 2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我升级的应用程序到网页API 2和的Application_Start不火后升级IIS防爆preSS运行。我也跟着在官方升级路径<一个href=\"http://www.asp.net/mvc/tutorials/mvc-5/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2\" rel=\"nofollow\">http://www.asp.net/mvc/tutorials/mvc-5/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2并已三重检查我的设置。

I upgraded an application to Web Api 2 and the Application_Start would not fire post upgrade running on IIS Express. I did follow the official upgrade path at http://www.asp.net/mvc/tutorials/mvc-5/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2 and have triple checked my settings.

该应用程序使用StructureMap MVC 4注入依赖。所以WebActivator的preApplicationStartMethod被炒鱿鱼和依赖解析器得到正确设置。在这之后,没有其他的执行可以被追踪。我已经启用编辑并继续,但在的Application_Start开始是打不破点。

The application uses StructureMap MVC 4 to inject dependencies. So WebActivator's PreApplicationStartMethod gets fired and the dependency resolver gets set correctly. After that, no other execution can be traced. I have enabled Edit and Continue and yet break point at the start of Application_Start is not hit.

下面的一切,我已经试过:
一个。禁用preApplicationStartMethod和运行应用程序
湾更改Global.asax中的编译设置和code背后
C。创建具有类似结构的其他WebApi2项目,并设立减去实际code和工作正常

Here's all that I've tried: a. Disable PreApplicationStartMethod and run the app b. Change the compile settings of the Global.asax and the code behind c. Create another WebApi2 project with similar structure and set up minus the actual code and that works fine

我已经清洗并运行应用程序;还清理临时文件夹ASP.NET

I have cleaned and run the app; also have cleaned the Temp ASP.NET folder

鸭preciate对解决这一问题的帮助。

Appreciate the help towards resolving this issue.

推荐答案

您的应用程序启动后,您的调试器附加,为此你会不会在你的应用程序启动方法击中任何断点。一种解决方法是造成当你连接到进程你的web服务器重新启动:

Your debugger attaches after your application is started, therefor you won't hit any breakpoints in your application start method. A workaround is to cause your webserver to restart while you're attached to the process:

只需编辑你的web.config(只需添加一个空格),并保存它,这会让你的HTTP应用程序重新启动。

Simply edit your web.config (just add a space) and save it, this will make your http application restart.

这篇关于HttpApplication.Application_Start不烧成后升级到网页API 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆