andrewWinn
andrewWinn

Reputation: 1786

Parser Error in ASP.NET Web Application

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.

Upvotes: 1

Views: 2530

Answers (2)

Gonzalo
Gonzalo

Reputation: 21175

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"

Upvotes: 1

Franci Penov
Franci Penov

Reputation: 76021

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.

Upvotes: 2

Related Questions