This morning I needed to work on a long-standing ASP.NET web application project. I haven’t had to run it locally for quite a while. I updated my source from TFS, cleaned and built the solution, and started the project in debug mode. After logging in, I went to a page, and was suddenly staring at an unexpected and confusing exception:
The base class includes the field 'ScriptManager1', but its type (System.Web.UI.ScriptManager) is not compatible with the type of control (System.Web.UI.ScriptManager).
I put aside the surprise that a type was not compatible with itself, and checked the source control history. The specific page hadn’t been changed since the last time I’d tried it. I know the project is under active development, including a recent deployment of the latest version at the client site, so I had ever reason to believe the build should work.
Before sending a panicked email to my team, I did a quick Google search. I found a couple links of similar people with this problem in VS2008, but I’m still running VS2005.
I realized, however, that I had installed Framework versions 3.0 and 3.5 since I had last had to work on this project. I went to the project references, and checked that for System.Web.Extensions, and noticed that “Specific Reference” was set to false. I set this to true, rebuilt the project, and started the debugger again.
This time, success! The page displayed as expected.
What problems have you encountered from having multiple .NET Frameworks installed?
If you’re looking for a lot of fun, try running multiple versions of the framework, as well as multiple versions of second-tier frameworks like Fujitsu’s NetCOBOL.
Most issues I’ve run in to with just plain .NET framework versions seem to occur in the web-app space where the config file is so important.
In my case Specific Version was set to “True”, I set it to “False” and my solution work! This post really helpful. Thanks!
Where do you set the Specific Reference to True/False?
I think that I have the same problem, but don’t know where to change/set the setting.
Tim,
In the project, under “References,” right-click the specific reference that is giving you trouble, and “Properties” should be one of the menu options. In the properties window, you’ll see the Specific Version property.