【问题标题】:Add custom DLL files in nuget package in new csproj在新 csproj 的 nuget 包中添加自定义 DLL 文件
【发布时间】:2017-04-09 10:47:08
【问题描述】:

.nuspec 文件有 部分,新 csproj 文件包含本地化资源的替代方法是什么?如何添加自定义DLL文件?

【问题讨论】:

标签: nuget nuget-package csproj


【解决方案1】:

诀窍的第一部分是将您的第三方 DLL 添加到 nupkg。这样做:

      <ItemGroup>
    <Reference Include="ThirdParty">
      <HintPath>..\DLLs\ThirdParty.dll</HintPath>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Content Include="$(OutputPath)\ThirdParty.dll">
      <Pack>true</Pack>
      <PackagePath>lib\$(TargetFramework)</PackagePath>
    </Content>
  </ItemGroup>

如果您将此软件包安装到旧式 csproj 中,则会添加对 ThirdParty.dll 的引用。

但是,如果您将此软件包安装到新样式的 csproj 中,那么对ThirdParty.dll 的引用将不会被添加为引用,这很烦人。正在进行中...

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多