Skip to content

VS2013新增的Browser Link功能禁用

web240 edited this page Jul 28, 2016 · 2 revisions

###所有的VS2013项目都会默认开启Browser Link功能,默认在调试页面时,发现不断发请求,查源码,发现了这样一段

<!-- Visual Studio Browser Link -->
<script type="application/json" id="__browserLink_initializationData">
    {"appName":"Chrome","requestId":"16957c22b01443e3a46c2478921f17aa"}
</script>
<script type="text/javascript" src="http://localhost:2208/b1db94a676054d038dbf9b5d76d544c9/browserLink" async="async"></script>
<!-- End Browser Link -->

然而这些我们从没写过,这是哪来的呢 原来这是微软自动加上的,我们可以这样操作来关闭它

    我们在web.config文件加上
    <appSettings>  
        <add key="vs:EnableBrowserLink" value="false"/>  
    </appSettings>  
    或者  
    <appSettings>  
        <add key="debug" value="false"/>  
    </appSettings>  

英文解释如下
How do I turn off Browser Link?
You can uncheck “Enable Browser Link” and it will be turned off “ Browser Link” for all future requests made. image
You can also use the following appsettings in your web.config file.
1. Set appSetting “vs:EnableBrowserLink” to “false ““. This will disable Browser Link. image
2. Set debug= false in web.config file. This will also disable Browser Link. Note that debug= true is required for Browser Link feature to work.

Clone this wiki locally