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

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

问题描述

我有一个MVC4 Web项目与Razor,在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压缩,禁用缓存,删除临时编译的文件等等...我在Windows 8.1中使用VS2013专业版。

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.

我也尝试过<全球化> 项目和元 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.

任何解决方案?

推荐答案

可以是浏览器链接功能。在您的工具栏中查找:

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).

我想出这一点,注意到一堆请求 http:// localhost:64667 / 613318d74fb54ab5bed269c36eb39fde / arterySignalR / connect ... 在Fiddler,我从来没有见过。此外,使用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天全站免登陆