Conflict with App_Code.xxxx.dll and website DLLs on WAP projects

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.

Tags:

Powered by BlogEngine.NET 1.5.0.7
Theme by Interakting

Interakting

A full service digital agency offering online strategy, design and usability, systems integration and online marketing services that deliver real business benefits and ensure your online objectives are met.

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar