You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在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:
    --user-data-dir="C:\Temp\VSChromeTempProfile"
    
    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.

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-dir flag 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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 07:06:58