Fix for Precompiled websites from VS2010 on .NET 3.5 for CSSFriendly adapters

Having recently upgraded my development platform to Visual Studio 2010 (VS2010) I found that my website when precompiled and uploaded to my client server, broke the CSSFriendly adapters that enable CSS-compatible controls with .NET 3.5.

I only use the ASP.NET menu control, and when I uploaded my precompiled website to my client’s server, the menu system CSS was not working.

Checking the site showed that the CSSFriendly DLL and .browser files were present. However the menu was being rendered as the old table-style HTML and not the <UL> <LI> css-format. Clearly CSSFriendly was not getting loaded.

After some experiments we discovered that the pre-compiled .browser file, called __browserCapabilitiesCompiler.compiled in the bin directory of the website contained the virtual root of the website from the development box. However, editing this file to remove the root path didn’t fix it. As a last attempt we deleted the pre-compiled .browser file, and lo! the site now worked correctly.

So the simple fix is to delete the __browserCapabilitiesCompiler.compiled file from the BIN directory of the website.

Advertisements

18 thoughts on “Fix for Precompiled websites from VS2010 on .NET 3.5 for CSSFriendly adapters

  1. Thank yo very much for take the time to publish and share this solution!!! So simple to fix, but I’m sure were no so to found.
    regards!

  2. We found the same problem on our site. This file keeps causing an APPCRASH on IIS7. We have an uncompiled website, but deleting it also fixes the problem.

    This is for anyone else who spends a whole day trying to find the error. IIS APPCRASH caused by __browserCapabilitiesCompiler.compiled. Remove the file from the compiled directory.

  3. Nice; this just hit me while a client was trying to configure an application. In all the years I’ve been using the adapters I’ve never hit this problem, and thankfully you’d blogged it to save me time (and embarrassment!). Thanks.

  4. So, is there a way to keep this file from returning every time I recompile, or do I have to remember to delete the file whenever a modification is made to the application and it is redeployed?

    • You can add a post-build event command line command to delete the file – that way it will always be removed if it appears. Something like del $(OutDir)\__browserCapabilitiesCompiler.compiled should work.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s