如何在Visual Studio中启动网站时无需JavaScript Debugging打开新Chrome实例
Launch a Clean Chrome Instance in Visual Studio Without JavaScript Debugging
Got it, let's sort this out—you want a fresh Chrome instance from Visual Studio without enabling JavaScript Debugging (since that's causing ServiceWorker glitches and you prefer Chrome's native dev tools anyway). Here's exactly how to make it happen:
Step-by-Step Setup
- Right-click your project in the Solution Explorer and select Properties.
- Navigate to the Debug tab—this is where all your launch configuration lives.
- Under Launch browser, confirm Google Chrome is selected as your target browser.
- Uncheck the box labeled Enable JavaScript Debugging for ASP.NET (Chrome, Edge and IE)—this is the setting that's triggering those ServiceWorker errors.
- To force Chrome to spin up a completely clean, isolated instance (no existing extensions, cache, or user profile baggage), add this command-line argument in the Command line arguments field:
Feel free to use any temporary directory path you like—Chrome will create the folder automatically if it doesn't exist. This ensures you get a blank, fresh Chrome session every time you launch from VS.--user-data-dir="C:\Temp\VSChromeTempProfile"
Why This Works
- Disabling JavaScript Debugging removes Visual Studio's debugging hook into Chrome, which eliminates the ServiceWorker conflicts you're encountering.
- The
--user-data-dirflag tells Chrome to use a temporary, standalone user profile instead of your default one. This replicates the "blank instance" behavior you get when enabling JS debugging, but without the debugging overhead and associated issues. - You’ll still have full access to Chrome’s native DevTools (hit F12 as usual) with all its robust debugging features intact.
内容的提问来源于stack exchange,提问作者NomenNescio
相关产品推荐
相关产品推荐

