Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Page uses an invalid or unsupported form of compression when debugging ASP.NET MVC app with Visual Studio 2013 Preview

While trying to debug an ASP.NET MVC project using the recently released VS 2013 Preview I get this message:

Content Encoding Error

The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

Please contact the website owners to inform them of this problem.

In Firebug I see this error message:

SecurityError: The operation is insecure

Tried with Google Chrome and IE 11 and the same problem happens.

What is causing this?

Note: I'm on Windows 8.1 and debugging the site using IIS Express at http://localhost:7777

I can debug it just fine using VS 2012.

like image 815
Leniel Maccaferri Avatar asked Jun 29 '13 08:06

Leniel Maccaferri


2 Answers

For me - This issue was related to web.config related compression settings. I had this one in my web.config:

<staticContent>
  <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="14.00:00:00" />
</staticContent-->

Which is supposed to cache static content, but apparently was corrupting my css files, and the browser couldn't view them. I just removed this line, and everything started working again.

like image 185
MunsterMan Avatar answered Nov 16 '22 02:11

MunsterMan


Well... after trying some options, I disabled Browser Link in VS 2013 toolbar and my app login page just appeared.

enter image description here

Looks like they need to do a bit more work on this because it didn't work out of the box in my case.


After debugging the issue with Microsoft devs, Mads Kristensen (PM on ASP.NET) got to the bottom of the problem that was in my Web.config file.

Inside <system.webServer> element I have:

<urlCompression doDynamicCompression="true"
                doStaticCompression="true"
                dynamicCompressionBeforeCache="true" />

That dynamicCompressionBeforeCache="true" interferes with HttpModules (which is what is used by Browser Link). Setting it to false enables Browser Link in Visual Studio 2013 Preview.


References

Browser Link is used for connecting Visual Studio directly to browsers.

Browser Link – SignalR channel between browser and Visual Studio

Browser Link feature in Visual Studio Preview 2013

like image 37
Leniel Maccaferri Avatar answered Nov 16 '22 02:11

Leniel Maccaferri