views:

147

answers:

2

I have inherited a Web Application project (3 files per aspx page), along with a second solution which contains the business and datalayers as a class library. I created an empty solution, added the class library project to it, along with the Web Application. I then added a reference to the class library from the Web Application. When I try to debug the site, I get a parser error:

Parser Error Message: The type 'Electro_Spec.Masters.MasterPage' is ambiguous: it could come from assembly 'C:\projects\esWOT3\WebSite\bin\Electro-Spec.DLL' or from assembly 'C:\projects\esWOT3\WebSite\bin\WebSite.DLL'. Please specify the assembly explicitly in the type name.

Why would this be? And how do I fix it?

EDIT the only reference to Electo_Spec.dll is from the Web Application "refrences", the class library was added to the site via the add reference to existing project dialogue. If I remove it, the site won't compile. Additionally the name of the web application is WebSite . . . thus the "Website.dll" . . . i believe, as I am new to web applicaitons (versus .net websites). Oh and this was all built in an empty solution. Additionally I have tried renaming the MasterPage to MasterPage1 to no avail.

+1  A: 

The Electro_Spec.Masters.MasterPage class is defined in both projects.

Remove the Electro_Spec.Masters.MasterPage from one of the two projects or change the namespace for one of the two MasterPage classes.

Franci Penov
It turns out there were namespace conflicts **ALL** over the project . . . I was told it was the production code base, but I have no clue how it compiled. I ended up renaming all of the class declaration across the .aspx.cs and .aspx.designer files and I changed the Inherits attribute on the .aspx page to match those class names. This fixed it. Thanks.
andrewWinn
+1  A: 

Well, there's a type with the same name (Type.FullName) in those two assemblies. Are you sure those assemblies are not the same? If they are, delete one. If they are not, add the assembly name to the Inherits attribute, like: Inherits="Electro_Spec.Masters.MasterPage, Electro-Spec"

Gonzalo
I beleive WebSite.DLL is the .dll for the site its self, as the project was creatively named :)
andrewWinn