New development tools and frameworks get me excited, and since I’m the kind of person that likes my tools and frameworks to be up to date I downloaded VS2012. Among all the excitement I made a rather unwise decision to install it on my work machine.
I already had VS2010 installed and decided to install VS2012 side by side, the installation was smooth (although took quite some time). I fiddled around a bit with the new shiny tools and everything seemed to be excellent. When I wanted to do some real “work” work I started running into some issues.
One of the applications I’m working on is a colossal enterprise application. The application targets .NET 4.0. One of the projects is an ASP.NET Website. All the other projects in this solution build correctly (as expected) except the website project, the compiler spits out this error:
The best overloaded method match for ‘System.Web.UI.HtmlControls.HtmlTableRowCollection.Add(System.Web.UI.HtmlControls.HtmlTableRow)’ has some invalid arguments
That error got me suspicious since the solution used to build without issues before installing VS2012 and .NET 4.5. I decided to create a blank website project and try to reproduce the issue. I had a web page that contained this code:
<table runat="server" id="tbl1"> <tbody> <tr> <td> </td> </tr> </tbody> </table>
The above code gave me the compile error mentioned above. Removing the “runat” attribute OR the “tbody” tag made the project compile without problems. To make matters even more confusing the projects fails to build with the above error but publishes successfully! I searched the internet and no one seems to have run into a similar situation.
Also this issue doesn’t occur in ASP.NET WebApplication projects (exact same code!)
I tried re-installing VS2010 but nothing changed. I uninstalled VS2012 and .NET 4.5, that caused VS2010 to crash on startup and all I get is this log entry:
TFS Shell Extension event:\n Failed to start COMProvider while updating workspaces.
So I re-installed VS2012 again. That seemed to solve my issue and my projects now build without errors. What really bugged me is that I didn’t know the source of the problem (to be honest I was mostly concerned about restoring my work environment). I guess I’ll have to wait a bit until I can install VS2012 on my work machine.
Has anyone had issues running VS2012 and VS2010 side by side ?
Microsoft has acknowledged this issue and will soon release a hotfix. More info here
Update 2: 1/9/2013
Today Microsoft release multiple fixes for .NET 4.5 and the issue was finally resolved. Update details.