问题描述
我继承了一个Web应用程序项目(每个aspx页3个文件),以及第二个解决方案,其中包含业务和数据层作为类库.我创建了一个空解决方案,并向其中添加了类库项目以及Web应用程序.然后,我从Web应用程序添加了对类库的引用.当我尝试调试站点时,出现解析器错误:
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:
解析器错误消息:类型"Electro_Spec.Masters.MasterPage"不明确:它可能来自程序集"C:\ projects \ esWOT3 \ WebSite \ bin \ Electro-Spec.DLL"或来自程序集'C:\ projects \ esWOT3 \ WebSite \ bin \ WebSite.DLL'.请在类型名称中明确指定程序集.
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?
编辑,对Electo_Spec.dll的唯一引用来自Web应用程序"refrences",该类库是通过对现有项目对话框的添加引用添加到站点的.如果删除它,该站点将无法编译.此外,Web应用程序的名称是WebSite...因此是"Website.dll"...我相信,因为我是Web应用程序的新手(相对于.net网站).哦,这全都建在一个空解决方案中.另外,我尝试将MasterPage重命名为MasterPage1无济于事.
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.
推荐答案
在两个项目中都定义了 Electro_Spec.Masters.MasterPage
类.
The Electro_Spec.Masters.MasterPage
class is defined in both projects.
从两个项目之一中删除 Electro_Spec.Masters.MasterPage
,或更改两个 MasterPage
类之一的名称空间.
Remove the Electro_Spec.Masters.MasterPage
from one of the two projects or change the namespace for one of the two MasterPage
classes.
这篇关于ASP.NET Web应用程序中的解析器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!