“复制本地”不会将程序集复制到输出目录

时间:2011-07-18 12:59:25

标签: .net visual-studio-2010

我有一个程序集X,它从lib文件夹引用System.InteractiveSystem.Reactive。 然后我有引用X的程序集Y。

在X中,System.InteractiveSystem.Reactive,“复制本地”设置为true。 在Y for X'Copy Local'设置为true。 System.ReactiveSystem.Interactive不属于GAC。

当我构建Y时,System.InteractiveSystem.Reactive不会复制到输出目录。为什么呢?

3 个答案:

答案 0 :(得分:4)

Y不从X继承“复制本地”选项。如果希望使用Y部署System.Interactive和System.Reactive,则从Y引用它们,并在Y中将它们标记为“Copy Local = true”

答案 1 :(得分:3)

这似乎解决了这个问题:How does visual studio determine what to copy to the output directory with multi-project solutions?

我手动将.csproj中的True添加到项目Y中对X的引用,并将程序集复制到输出目录。

答案 2 :(得分:1)

  1. 添加参考
  2. 添加链接
  3. 不需要在主项目中添加引用。 100%工作并将dll复制到bin文件夹。

     <Reference Include="NM86">
          <HintPath>..\..\..\NM86.dll</HintPath>
          <CopyToOutputDirectory>Always</CopyToOutputDirectory>
          <SpecificVersion>False</SpecificVersion>
          <Private>True</Private>
        </Reference>
       <Content Include="..\..\..\NM86.dll">
          <Link>NM86.dll</Link>
          <CopyToOutputDirectory>Always</CopyToOutputDirectory>
          <SpecificVersion>False</SpecificVersion>
        </Content>
    
相关问题