MSBuild不会复制依赖项目中引用的StrongName = false dll

编程入门 行业动态 更新时间:2024-10-25 06:20:10
本文介绍了MSBuild不会复制依赖项目中引用的StrongName = false dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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

social.msdn.microsoft/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 linkand for me, only StrongName=false dlls are not getting copied over.

social.msdn.microsoft/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 folderof 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 ofmain 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

本文发布于:2023-11-13 10:30:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1584130.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:项目   MSBuild   StrongName   dll   false

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!