部署项目dll导致“两个都存在类型x"错误 [英] Deployment Project dlls cause 'type x exists in both' errors

查看:50
本文介绍了部署项目dll导致“两个都存在类型x"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用于Web应用程序的WebApplication项目,一个业务逻辑项目和一个WebDeployment项目.

I have a WebApplication project, a business logic project, and a WebDeployment project for the web app.

构建解决方案时,部署发布"箱中的每个项目都包含1个dll-因此,我为MyWeb.dll,MyWebBusiness.dll和MyWebDeploy.dll获得了一个.

When I build solution, the deployment "Release" bin contains 1 dll for each of the projects - so I get one for MyWeb.dll, MyWebBusiness.dll, and MyWebDeploy.dll.

当我尝试运行该站点时,它在MyWeb.dll和MyWebDeploy.dll中都看到相同的类型,并且阻塞了.

When I try to run the site, it sees the same type in both MyWeb.dll and MyWebDeploy.dll and chokes.

错误消息:CS0433:类型'AV'同时存在于'c:\ WINDOWS \ Microsoft.NET \ Framework \ v2.0.50727 \ Temporary ASP.NET Files \ root \ 53d45622 \ 6c032bd2 \ assembly \ dl3 \ 33f3c6b2 \ abc9430a_285ac901 \ MyWeb.DLL'中和'c:\ WINDOWS \ Microsoft.NET \ Framework \ v2.0.50727 \ Temporary ASP.NET Files \ root \ 53d45622 \ 6c032bd2 \ assembly \ dl3 \ 631e5302 \ 0231160d_285ac901 \ MyWebDeploy.DLL'

Error message: CS0433: The type 'AV' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\53d45622\6c032bd2\assembly\dl3\33f3c6b2\abc9430a_285ac901\MyWeb.DLL' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\53d45622\6c032bd2\assembly\dl3\631e5302\0231160d_285ac901\MyWebDeploy.DLL'

推荐答案

我能想到的一些原因:

  • 您的项目中有一个 App_Code 目录
  • 您在某个页面标记中具有一个 CodeFile 页面指令,而不是 CodeBehind
  • You have an App_Code directory in your project
  • You have a CodeFile page directive in the some page markup instead of CodeBehind

这篇关于部署项目dll导致“两个都存在类型x"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆