Referenced library isn't copied

前端 未结 3 1587
暖寄归人
暖寄归人 2020-12-19 05:55

I have ProjectA(WPFApplication) that references ProjectB(ClassLibrary). Inside ProjectB i have wpf window that uses contro

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-19 06:41

    Add something like this to ProjectB.csproj:

    
       
          ThirdParty.dll
          PreserveNewest
       
    
    

    This convinces VS to copy ThirdParty.dll to the output folder of ProjectA, too (no need to add anything to ProjectA about ThirdParty.dll).
    I still find it inadequate because if ThirdParty.dll is in a NuGet package, its path usually contains version number, which will change when you update the package.
    I haven't tried it yet but I don't expect from NuGet to update the path here as it does in .

提交回复
热议问题