Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在新csproj的nuget包中添加自定义DLL文件_Nuget_Nuget Package_Csproj - Fatal编程技术网

在新csproj的nuget包中添加自定义DLL文件

在新csproj的nuget包中添加自定义DLL文件,nuget,nuget-package,csproj,Nuget,Nuget Package,Csproj,.nuspec文件有一节,新csproj文件包含本地化资源的备选方案是什么?如何添加自定义DLL文件?技巧的第一部分是将第三方DLL添加到nupkg。这就是: <ItemGroup> <Reference Include="ThirdParty"> <HintPath>..\DLLs\ThirdParty.dll</HintPath> </Reference> </ItemGroup&g

.nuspec文件有一节,新csproj文件包含本地化资源的备选方案是什么?如何添加自定义DLL文件?

技巧的第一部分是将第三方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>

..\dll\ThirdParty.dll
真的
lib\$(TargetFramework)
如果将此软件包安装到旧式csproj中,则会添加对
ThirdParty.dll
的引用

但是,如果您将此软件包安装到一个新样式的csproj中,那么对
ThirdParty.dll
的引用将不会作为引用添加,这令人恼火。正在进行的工作…

可能重复的