简体   繁体   English

虽然在Edge和Internet Explorer中可以运行ASP.Net MVC应用程序,但不能在Chrome中使用

[英]ASP.Net MVC app not working in chrome although it does in Edge and Internet explorer

my question is about asp.net mvc, it used to display the UI correctly in google chrome up until yesterday, because today it is broken. 我的问题是关于asp.net mvc的,它一直用来在google chrome中正确显示用户界面,直到昨天,因为今天它坏了。

It displays everything correctly in internet explorer or edge, but it shows code in chrome which is not present in visual studio itself from which I run my project. 它可以在Internet Explorer或Edge中正确显示所有内容,但以chrome显示代码,而我运行项目所用的Visual Studio本身却不存在。 (the code that is displayed in chrome debugger I used to have in my project but I deleted it in visual studio, though it still appears in chrome producing a wrong result). (我以前在项目中拥有的chrome调试器中显示的代码,但我在Visual Studio中将其删除,尽管它仍然出现在chrome中并产生错误的结果)。

I had my project uploaded to github (that version of my project was working fine in chrome) so I tried pulling it but git told me "my project is already up to date" so it did not fix it. 我将项目上载到github(该项目的版本在chrome上运行正常),所以我尝试将其拉出,但是git告诉我“我的项目已经是最新的”,因此它没有修复。

I attached some pictures which can help identify the problem. 我附上了一些图片,可以帮助您确定问题所在。

css file present in Visual studio Visual Studio中存在的CSS文件

css file shown in chrome debugger chrome调试器中显示的css文件

thanks for your help in advance 谢谢你的帮助

Your css present in Visual Studio is called Site.css Visual Studio中存在的CSS称为Site.css

Your css in chrome debugger is site.css 您在Chrome调试器中的CSS是site.css

Considering those files are case-sensitive, that could be one reason for those files to not work, except in IE locally on Windows, where the files are not case sensitive. 考虑到这些文件区分大小写,这可能是这些文件不起作用的原因之一,但Windows本地IE中的文件区分大小写除外。

Check if your css file has been renamed recently, from s/S[ite.css] to S/s[ite.css] . 检查您的css文件最近是否已从s/S[ite.css]重命名为S/s[ite.css]

When reference your file, use @Url.Content("~/style/example.css") to make sure that you referencing the correct file maybe same file on wrong path. 当引用您的文件时,请使用@ Url.Content(“〜/ style / example.css”)来确保引用的文件正确,也许是错误路径下的同一文件。

Also: Try to click ctrl + F5 on chrome to force refresh the browser. 另外:尝试在Chrome上单击Ctrl + F5强制刷新浏览器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM