Debugging Websites with Google Chrome

2020-03-31 07:17发布

When writing an ASP.NET website, Visual Studio allows me to specify which browser to use for debugging. I've just started playing with MVC 3 and I'm not seeing any such option.

With MVC, debugging occurs in Google Chrome, which is fine except that Visual Studio doesn't recognize when I've closed the browser. I must then manually shut down the debugger.

Is there a way to either A) have the Visual Studio debugger recognize when I've stopped debugging the website in Chrome, or B) specify that IE should be used when debugging? (I prefer to keep Chrome as my default browser when browsing the Web.)

3条回答
叛逆
2楼-- · 2020-03-31 07:53

When you debug a web application, Visual Studio simply attaches itself to the IIS process (or the development server process, if you're using that), and starts the browser with the correct URL. The browser doesn't even know you're debugging. With IE, Visual Studio performs some additional inter-process voodoo to detect when IE closes; other browsers however are unaware of this mechanism and simply do what they always do - display the page until the user closes it. So your choices are:

  • Live with the fact that you'll have to close the browser manually
  • Reuse browser windows (instead of running the browser from inside Visual Studio, use "Attach to process" and open the page manually)
  • Bite the bullet and use IE
查看更多
Fickle 薄情
3楼-- · 2020-03-31 08:06

To keep IE as you browser right click on an aspx file and click browse with. you should be able to set a default from there.

If you don't have an aspx form just create one, set pref then delete.

查看更多
放荡不羁爱自由
4楼-- · 2020-03-31 08:07

I believe this extension allows you to choose your browser with MVC applications. Or, you could just add a normal HTML page, and set the browser default on that. This should become the default for the rest of your project.

查看更多
登录 后发表回答