Visual Studio 2013 产生乱码/损坏/错误编码的 html [英] Visual Studio 2013 produces garbled/corrupted/wrong-encoded html

查看:16
本文介绍了Visual Studio 2013 产生乱码/损坏/错误编码的 html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有 Razor 的 MVC4 Web 项目,它在 VS2012 中运行良好.在 VS2013 中,在干净重建后,同一个 web 项目生成带有编码问题的 html.它看起来像这样.很多 (深色菱形中的问号字符)

I have a MVC4 Web project with Razor, which works fine in VS2012. In VS2013, after clean-rebuild, the same web project produce html with encoding issues. its looks like this. Lots of ��� (question mark characters in a dark diamond)

我很确定它的 VS2013 是原因——我尝试过重新安装 IIS、重新创建网站、禁用 gzip 压缩、禁用缓存、删除临时编译文件等等等......我正在使用 VS2013 专业版视窗 8.1.

I am pretty sure its VS2013 that is the cause - I have tried re-installing IIS, recreating the websites, disabling gzip compression, disabling caching, deleting temporary compiled files etc etc etc... I am using VS2013 Pro Edition in Windows 8.1.

如果我切换回 VS2012 并清理重建,响应就会恢复正常.

If I switch back to VS2012 and clean-rebuild the response is back to normal.

我还尝试了项目中的 <globalization> 元素和元 Content-Type 与 http 标头、内容类型值的各种组合等相同,以修复 VS2013 中的编码 - 全部无效.

I have also tried the <globalization> element in project, and meta Content-Type and same with http headers, various combinations of content type values etc, to fix encoding in VS2013 - all to no effect.

有什么解决办法吗?

推荐答案

可能是 浏览器链接 VS 2013 功能.在您的工具栏中查找:

Could be the Browser Link feature in VS 2013. Look for this in your toolbar:

取消选中启用浏览器链接并重新加载网页(不需要重新构建).

Uncheck Enable Browser Link and reload the web page (rebuild shouldn't be necessary).

我发现了这一点,注意到 Fiddler 中的一系列请求,例如我以前从未见过的 http://localhost:64667/613318d74fb54ab5bed269c36eb39fde/arterySignalR/connect....此外,在 Fiddler 中使用检查器的 Raw 选项卡显示大量随机的不可打印字节被注入到我的网页的 HTML 中.

I figured this out noticing a bunch of requests like http://localhost:64667/613318d74fb54ab5bed269c36eb39fde/arterySignalR/connect... in Fiddler that I had never seen before. Also, using the Raw tab of the inspector in Fiddler showed lots of random unprintable bytes being injected into the HTML of my web pages.

这篇关于Visual Studio 2013 产生乱码/损坏/错误编码的 html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆