Visual Studio Do not open new browser instance

2019-01-13 14:16发布

问题:

when I try to run a web application in visual studio 2017RC on windows 10, it opens a new browser instance(in my case chrome). I've tried also with internet explorer, situation is same, and browser not signed in, but if I just manually run chrome it is signed in. How to prevent visual studio to run a new browser instance on each time I run web application? When I press run website it should be opened in same window as previous application(just next tab)

回答1:

I've discovered that Turning off Javascript debugging means that sites open in a new tab of an existing Chrome instance. From what I've seen the in Visual Studio debugging is not as good as Chrome's dev tools so turning this off is not an issue for me.

UPDATE

As of VS2017 15.7.1 this fix no longer works and I've found I've had to additionally uncheck Stop debugger when browser window is closed



回答2:

You can disable the website from being launched at all from the debug settings.

Once the web application is running you can launch the website from the taskbar.

The "Browse With..." menu option appears to launch the website without running the debug session in VS2017 which might not be what you want.



回答3:

I wanted to share the reason of the issue as well as the screen shot. The reason for which it opens a new window is because JS debugging is enabled. Chrome is launched with debugging enabled so a new instance is required. If you want to revert to the old behavior from Visual Studio 2015, you can do so but you would have to disable JS debugging. See below:

Original Source

Original Discussion on Visual Studio Forum



回答4:

I prefer to set mine like this, I run the page from where I want (no new instance or tab opening)