简体   繁体   English

Nuget / MSBuild:为多个第 3 方 DLL 版本构建

[英]Nuget / MSBuild : Build for multiple 3rd Party DLL versions

The scenario is as follows: I have multiple versions of 3rd party DLLs (specifically one for each year that the third party product is released).场景如下:我有多个版本的 3rd 方 DLL(特别是第三方产品发布的每一年都有一个版本)。 I need to be able to build for multiple different versions of these DLLs in order to deploy different versions of the application.我需要能够为这些 DLL 的多个不同版本进行构建,以便部署不同版本的应用程序。

I found that I can achieve this using MS-Build like so:我发现我可以使用 MS-Build 来实现这一点,如下所示:

<ItemGroup Condition=" '$(Configuration)' == '2009 Release' ">
  <Reference Include="thirdPartyLib">
   <SpecificVersion>False</SpecificVersion>
   <HintPath>..\lib_2009\thirdPartyLib.dll</HintPath>
   <Private>True</Private>
  </Reference>
</ItemGroup>
<ItemGroup Condition=" '$(Configuration)' == '2010 Release' ">
  <Reference Include="thirdPartyLib">
   <SpecificVersion>False</SpecificVersion>
     <HintPath>..\lib_2010\thirdPartyLib.dll</HintPath>
   <Private>True</Private>
  </Reference>
</ItemGroup>

However I thought it was also worth while checking whether there was an easy way to handle this kind of scenario using Nu-Get.但是,我认为检查是否有使用 Nu-Get 处理这种情况的简单方法也是值得的。 Any thoughts on doing this with Nu-Get or MS-Build or even Powershell would be appreciated.任何关于使用 Nu-Get 或 MS-Build 甚至 Powershell 进行此操作的想法将不胜感激。

I don't think this is possible, but I did find this post in the discussion forums:我认为这是不可能的,但我确实在论坛中找到了这篇文章:

http://nuget.codeplex.com/discussions/253168 http://nuget.codeplex.com/discussions/253168

It seems like a reasonable request - certainly having debug/release versions.这似乎是一个合理的要求——当然有调试/发布版本。 Might be worth adding to that post, or creating a request in the issue tracker to see if the team will consider providing support for this.可能值得添加到该帖子中,或者在问题跟踪器中创建请求以查看团队是否会考虑为此提供支持。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM