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.