简体   繁体   中英

Unable to debug ASP.Net MVC Applications

I am having problems debugging my web applications.

When I try to Debug my website I get an error saying:

The system cannot find the specified file

系统找不到指定的文件

Now when I try to Debug again, there will be no error and it tries to open the page, but it doesn't load because IIS is not on.

And when IIS is on and I press the debug the page loads fine, but it doesn't hit the breakpoints I set.

Also the start button doesn't say "Google Chrome", but just "Start" 开始按钮

I thought this was only with this project, but this also happens in my other ASP.NET MVC Project.

I've tried restarting Visual Studio and my laptop, but that didn't solve it either. I also tried cleaning and rebuilding the solution.

Has anybody experienced this problem before?

Your problem with the Debug button showing "Start" occurs only if you set the Application Startup¹ to:

  • a WPF project or
  • a WindowsForms project or
  • a ClassLibrary project or something like this.

Otherwise, your WebApplication project or solution needs a review. Did you check these files? If not, check the configurations. See the Start Action in Web as the image below².

Web应用程序属性

Another tips I can give you is to always Build your project during coding to see if everything is OK and sometimes do a Clean Solution and Rebuild it. When something is not correct, try restarting your Visual Studio or disabling some extensions.

Also, here are a few questions to help you too:

Some of the answers even when not accepted can help you clarify why did you get this issue.

Hope this can be useful and I am glad you've solved the problem. Now, try to understand it.

--

  1. You can set the Application Startup project by right-clicking the project in the solution and then click "Set as StartUp project".
  2. To view the Project Properties as shown, right-click the project in the solution and then click "Properties" or select the project in the solution and use the shotcut ALT + ENTER.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM