0

When I'm using Visual Studio Development Server (http://localhost:64217/application) CSS gets lost and Chrome is showing the following warnings and errors:

Resource interpreted as Stylesheet but transferred with MIME type text/html: 
Uncaught SyntaxError: Unexpected token <

When using IIS server (http://localhost/application) the styles are fine.

I've checked these duplicate questions Visual Studio Development Server not updating css and javascript? and Lose “modern” (CSS3) styles when viewing on IIS vs VS Development Server [closed]. Unfortunately none of them helped me.

I've tried clearing the cache and also didn't help. Any guesses what might cause this to happen are very appreciated.

Also I have to mention that this happened today. Back in the past I was using both IIS and Development Server and I didn't have this problem.

EDIT

I'm using Jquery Mobile and I've included the JQM CSS in the master page:

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" runat="server" />

All the other CSS files are included in App_Themes/Default and included in the web.config:

<pages theme="Default" />
Community
  • 1
  • 1
Anton Belev
  • 11,963
  • 22
  • 70
  • 111
  • You are missing `type="text/css"` on the ``. The correct declaration is: `` – Caelea Aug 07 '13 at 11:24
  • why would you even need `runat="server"` on that? (/cc @Caelea) – Marc Gravell Aug 07 '13 at 11:25
  • The "Resource interpreted as Stylesheet but transferred with MIME type text/html" message suggests the browser is returning html instead of css... so: what *do* you get if you navigate to the css url? A yellow screen of death, perhaps? – Marc Gravell Aug 07 '13 at 11:26
  • @MarcGravell I'm getting normal row html page without css. I found the error in the Error Log in Chrome. About the `runat="server"` - I've googled the error and there were some suggestions to include `runat="server"` but still doesn't work. – Anton Belev Aug 07 '13 at 11:29
  • @Caelea I've copied the include reference from the JQuery Mobile web-site. I've just added `runat="server"`. Anyway I've tried your suggestion, but still doesn't work :( – Anton Belev Aug 07 '13 at 11:31
  • Did you try to copy the jQuery Mobile CSS into a local folder of your web app and see if it's loading? – ᗩИᎠЯƎᗩ Aug 07 '13 at 11:41
  • @Andreaoid no, I've not tried it, since I'm already using themes and the css/imgs which are in the project are not showing(not only the JQM CSS) - why even trying to copy the JQuery Mobile CSS. – Anton Belev Aug 07 '13 at 11:44
  • Do you have any reference to the port you're using? It happened to me in the past that VS changes the port - when it's busy or for other reasons - (64217 in your case) and my old references to the old port didn't work anymore. – ᗩИᎠЯƎᗩ Aug 07 '13 at 11:47

0 Answers0