[英]Why a dll is copied from GAC to project\bin folder
Having the following situation: 具有以下情况:
The problem is that every time I make a build the dll, pdb and xml are copied to the bin folder and I get: 问题是,每次我进行构建时,dll,pdb和xml都会复制到bin文件夹中,并且得到:
Could not load file or assembly 'Aaa.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
if I don't delete the dll before running the program. 如果我在运行程序之前不删除dll。
I have never encountered a similar problem and I have no idea how diagnose it. 我从未遇到过类似的问题,也不知道如何诊断。 Any suggestions?
有什么建议么?
Edit: I forgot to metion. 编辑:我忘了提及。 This dll is not referenced in References of the project.
此DLL 是不是在项目的参考 引用 。 (I don't see it in visual studio project explorer under: MySolution -> MyProject -> References
(我在Visual Studio项目浏览器中没有看到它:MySolution-> MyProject-> References
Edit (@chappo thanks for a new insight) Running MsBuild I see: 编辑 (@chappo感谢您提供新的见解),正在运行MsBuild,我看到:
_CopyFilesMarkedCopyLocal:
Copying file from "C:\MyCompany\MyProjects\Project1\App_Code\AjaxControlToolkit.dll" to "bin\AjaxControlToolkit.dll".
Copying file from "C:\Program Files (x86)\Reference Assemblies\MyCompany\Aaa.dll" to "bin\Aaa.dll".
Copying file from "C:\Program Files (x86)\Reference Assemblies\MyCompany\Aaa.pdb" to "bin\Aaa.pdb".
Copying file from "C:\Program Files (x86)\Reference Assemblies\MyCompany\Aaa.xml" to "bin\Aaa.xml".
The dll is indeed marked as copy local the question now is where? 该dll确实被标记为本地副本,现在的问题在哪里?
I had similar issue once. 我曾经有过类似的问题。 As you have 64 bit system, check if 'Aaa.dll' is 32 bit dll.
如果您使用的是64位系统,请检查“ Aaa.dll”是否为32位dll。 If it is, then you have to change Application Pool settings in IIS to Enable 32 bits application.
如果是这样,则必须在IIS中更改“应用程序池”设置以启用32位应用程序。
You can find detailed description here: https://help.webcontrolcenter.com/KB/a1114/how-to-enable-32-bit-application-pool-iis-7-dedicatedvps.aspx 您可以在这里找到详细的描述: https : //help.webcontrolcenter.com/KB/a1114/how-to-enable-32-bit-application-pool-iis-7-dedicatedvps.aspx
Try to clean your solution file. 尝试清理您的解决方案文件。
I experienced like this one a long time ago. 我很久以前就经历过这样的经历。 But in my case, one of my project could not locate the .dll of my another project.
但就我而言,我的一个项目无法找到另一个项目的.dll。 I searched for the answer and I only came up on using this method.
我搜索了答案,然后才开始使用这种方法。
Try to look here also. 尝试也看这里。 Rebuild Visual Studio Library Project Reference
重建Visual Studio库项目参考
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.