为什么将dll从GAC复制到project \ bin文件夹 [英] Why a dll is copied from GAC to project\bin folder

查看:107
本文介绍了为什么将dll从GAC复制到project \ bin文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

具有以下情况:

  • Windows 7 64位
  • Visual Studio 2010
  • 包含asp.net 2.0中项目的解决方案
  • 在文件夹中: C:\ Program Files(x86)\ Reference Assemblys \ CompanyName \ 我有文件:
    • Aaa.dll
    • Aaa.pdb
    • Aaa.xml(xmldoc) 在我的解决方案中的任何项目中都没有引用该dll(实际上,我的解决方案中只有一个项目
    • Windows 7 64bit
    • Visual Studio 2010
    • A solution containing a project in asp.net 2.0
    • In the folder: C:\Program Files (x86)\Reference Assemblies\CompanyName\ I have files:
      • Aaa.dll
      • Aaa.pdb
      • Aaa.xml (xmldoc) The dll is not referenced in any of my projects in my solution (actually there's only one project in my solution

      问题在于,每次进行构建时,dll,pdb和xml都会复制到bin文件夹中,并且我得到:

      The problem is that every time I make a build the dll, pdb and xml are copied to the bin folder and I get:

      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.
      

      如果我在运行程序之前不删除dll.

      if I don't delete the dll before running the program.

      我从未遇到过类似的问题,也不知道如何诊断.有什么建议吗?

      I have never encountered a similar problem and I have no idea how diagnose it. Any suggestions?

      编辑:我忘记了提及.在项目的参考中未引用该dll . (我在Visual Studio项目资源管理器中的以下位置看不到它: MySolution-> MyProject->参考

      I forgot to metion. This dll is not referenced in References of the project. (I don't see it in visual studio project explorer under: MySolution -> MyProject -> References

      编辑(@ chappo感谢您提供新的见解) 运行MsBuild,我看到了:

      Edit (@chappo thanks for a new insight) Running MsBuild I see:

      _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".
      

      该dll确实标记为本地副本,现在的问题在哪里?

      The dll is indeed marked as copy local the question now is where?

      推荐答案

      我曾经遇到过类似的问题.如果您使用的是64位系统,请检查"Aaa.dll"是否为32位dll.如果是这样,则必须在IIS中更改应用程序池"设置以启用32位应用程序.

      I had similar issue once. As you have 64 bit system, check if 'Aaa.dll' is 32 bit dll. If it is, then you have to change Application Pool settings in IIS to Enable 32 bits application.

      您可以在此处找到详细说明:

      You can find detailed description here: https://help.webcontrolcenter.com/KB/a1114/how-to-enable-32-bit-application-pool-iis-7-dedicatedvps.aspx

      这篇关于为什么将dll从GAC复制到project \ bin文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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