by Dominic Zukiewicz
18. February 2008 12:23
Recently, we upgraded a project to a WAP project, but then we started getting errors about conflicts.
Here is an error we had:
Parser Error Message: The type 'CSSFriendly.MenuAdapter' is ambiguous: it could come from assembly 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\myproj\1f01e60c\21e000e7\App_Code.9qbk2vh7.DLL' or from assembly 'D:\WebSites\MyNewWebSiteProject\myproj\bin\myproj.DLL'. Please specify the assembly explicitly in the type name.
The parts that were conflicting were the App_Code.xxxxx.dll and the website DLL. But why???
The reason is that the ASP.NET process compiles on the fly, whereas the WAP project compiles all of the *.cs files into the web site's DLL. So therefore ASP .NET gets confused because it finds the class in both the App_Code folder (as a .cs file) and compiled into the website DLL.
The resolution is to rename the App_Code folder to something else - Old_App_Code or Classes etc.
When recompiled, you should not have the conflict any more.
b691ec18-0f89-41e2-8162-75b34fe080cd|0|.0
Tags: