MSBuild不会复制依赖项目中引用的StrongName = false dll [英] MSBuild doesn't copy StrongName=false dll's referred in a dependent project

查看:63
本文介绍了MSBuild不会复制依赖项目中引用的StrongName = false dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个项目A(主项目)参考项目B.项目B指的是2 DLLS D1(属性强名称= true)和D2 (强名称=假)。当我使用MSBuild发布项目A时,我将D1 dll复制而不是D2。有人可以解释一下我的问题是什么
?如果有任何其他解决方法(除了在项目A中引用D2),请告诉我。


我浏览了以下链接 对我来说,只有StrongName = false dlls不是复制过来。 


https://social.msdn.microsoft.com/Forums/vstudio/en-US/52407f5b-4e63-4071-bbf1-854ec5dac7b8/msbuild-doesnt -copy-references-dlls-if-using-project-dependencies-in-solution?forum = msbuild


D2的信息:Restsharp.dll,版本:104.4.0


框架:.Net 4.5


谢谢,


Adi。


解决方案

AdithyaRanganath,


感谢您在此发帖。


您是说D2 dll不会复制到ProjectA的bin文件夹或发布文件夹吗?


根据您的描述,我创建了一个主项目A,它引用了项目B.项目B引用的是Newtonsoft.Json.dll(属性强名称= true )。但是,当我发布项目A时,Newtonsoft.Json.dll没有复制到项目A的bin文件夹
。所以请你仔细检查是否已将D1.dll直接引用到你的主项目A,这样dll是否要复制到bin文件夹?


如果您仍想将D2.dll复制到主项目A的bin文件夹,那么如何在构建事件中将复制任务添加到ProjectB / ProjectA将D2.dll复制到主项目A?

 copy / Y" 


(TargetDir)

(项目名).DLL" "

Hi,

I am having a project A(main project) referring Project B. Project B is referring 2 DLLS D1(with property strong name=true) and D2(strong name=false). When I publish Project A using MSBuild, I get D1 dll copied over but not D2. Can someone explain me what the issue is please? If there is any other workaround(other than referring D2 in Project A), please let me know.

I went through the below link and for me, only StrongName=false dlls are not getting copied over. 

https://social.msdn.microsoft.com/Forums/vstudio/en-US/52407f5b-4e63-4071-bbf1-854ec5dac7b8/msbuild-doesnt-copy-references-dlls-if-using-project-dependencies-in-solution?forum=msbuild

Information of D2: Restsharp.dll, Version: 104.4.0

Framework: .Net 4.5

Thanks,

Adi.

解决方案

Hi AdithyaRanganath,

Thanks for posting here.

Do you mean that the D2 dll not copy to the bin folder or publish folder of ProjectA?

Accoring to your description, I have created a main project A, which referring the Project B. Project B is referring Newtonsoft.Json.dll (with property strong name=true). However, when I publish the Project A, Newtonsoft.Json.dll not copy to the bin folder of Project A. So could you please double check if you have referring the D1.dll directly to your main projectA, so that dll be copy to the bin folder?

If you still want to copy D2.dll to the bin folder of main projectA, how about add a copy task in the build event to the ProjectB/ProjectA to copy that D2.dll to the main project A?

copy /Y "


(TargetDir)


(ProjectName).dll" "


这篇关于MSBuild不会复制依赖项目中引用的StrongName = false dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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