ASP.Net Forms“类型同时存在于 dll1 和 dll2 中” Debug 模式下出错,Release 模式下不出错
在针对 .Net Framework 3.5 的网站项目中,我偶尔会收到如下错误:
类型“ASP._myetc_master”存在于“c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\site\3a65eca7\73f2d86b\App_Web_myetc.master.cdcab7d2.iefhoqis.dll”中' 和 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\site\3a65eca7\73f2d86b\App_Web_myetc.master.cdcab7d2.tgrvlldi.dll'
更新数据的后端库后经常会弹出此错误站点的访问层依赖于这些对象,并出现在依赖这些对象的页面中。我已删除了相关的临时 ASP.Net 文件文件夹,还删除并重新添加了相关的引用,并删除了 /bin 目录的内容。这些事情似乎都没有任何效果(尽管上次我遇到清除引用的问题似乎解决了问题)。
我仅在调试配置中构建时遇到错误 - 在发布配置中构建时不会发生错误。
如果我能在其他地方寻找原因或解决方案,我将不胜感激。
In a website project targeted for the .Net Framework 3.5 I occasionally get an error like the following:
The type 'ASP._myetc_master' exists in both 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\site\3a65eca7\73f2d86b\App_Web_myetc.master.cdcab7d2.iefhoqis.dll' and 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\site\3a65eca7\73f2d86b\App_Web_myetc.master.cdcab7d2.tgrvlldi.dll'
This error often pops up after updating a backend library that the data access layer for the site relies upon, and crops up in pages that rely on those objects. I have removed the Temporary ASP.Net Files folder in question, and have also removed and re-added the references in question and deleted the contents of my /bin directory. None of those things seem to have any effect (although the last time I encountered the problem clearing the references seemed to resolve the issue).
I only encounter the error when building in the Debug configuration - when building in the Release configuration the error doesn't occur.
Any pointers to where else I might look for a cause or solution would be highly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我想我已经解决了。我认为的独家新闻是:
我的解决方案是结构化的,因此我有一个数据访问层项目,该项目引用了我们的 ERP 系统的集成层。 Web 项目引用数据访问层。我在 Web 项目中也引用了集成层,因此本质上它被包含了两次;一次由 DAL 进行,一次由 Web 项目进行。删除 Web 项目层的引用解决了该问题。
我仍然有点困惑为什么错误消息指向母版页中的重复而不是集成层提供的对象中的重复。我也很困惑为什么 Web 项目在发布模式下构建得很好,但在调试模式下却不然。尽管如此,我的具体问题似乎已经解决。
OK, I think I resolved it. Here's what I think the scoop is:
My solution is structured so that I have a data access layer project that references an integration layer with our ERP system. The web project references the data access layer. I had the integration layer also referenced in the web project, so in essence it was being included twice; once by the DAL and once by the web project. Removing the reference at the web project layer resolved the issue.
I am still a little confused as to why the error message pointed to duplication in a master page and not in the objects provided by the integration layer. I am also confused as to why the web project built fine when in Release mode but not in Debug mode. Nevertheless, my specific problem appears to be resolved.