Saturday, February 09, 2008

Frustrations upgrading from VS2003 to VS2008

I have just upgraded one of my major projects from VS2003(!) ASP.NET to VS2008 Web Application Project. It went relatively well. One must remember to right click on the project and select 'Convert to Web Application' otherwise the designer.cs files are not created for the web pages.

When it was released it was throwing the following:

The type 'tcpIQ.Web.WebSite.LineSpeedMeter.Api.Soap.V401111.LsmSoapApi' is ambiguous: it could come from assembly 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\100c9fe3\aa17ce8c\App_Code.d11yv5mk.DLL' or from assembly 'C:\Inetpub\wwwroot\tcpiq.com\wwwroot\bin\TcpIQ.com.DLL'. Please specify the assembly explicitly in the type name.

There are lots of chatter about this exception and it appears that it can occur for a number of different reasons. In my case it was because in the conversion from 2003 to 2008 an 'App_Code' directory was created and some classes were placed in there. Files in this directory are dynamically compiled at run time and the DLLs are stored in the Temporary ASP.NET folder as opposed to the bin folder. Needless to say this trips up ASP.NET since it can see two different assemblies for the same class. The solution was to simply migrate the classes back out of the APP_Code folder and place them somewhere more suitable, recompile, re-release, recycle and it worked!


 

No comments: