小编Sab*_*ina的帖子

更改nuget包的输出目录

我从我的项目创建了一个 NuGet 包。包的输出目录是解决方案目录。我想将其输出到特定目录。我在 csproj 文件和 nuspec 文件中尝试了一个目标。没有一个工作。如何获取指定文件夹中生成的包?

在我的 .csproj 中:

<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
  <PropertyGroup>
    <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
  </PropertyGroup>
  <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
Run Code Online (Sandbox Code Playgroud)

在我的 .nuspec 中:

<?xml version="1.0"?>
<package >
  <metadata>
    <id>MyPackage.dll</id>
    <version>1.0.0</version>
    <authors>me</authors>
    <owners>me</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>Package description</description>
    <releaseNotes>Summary of changes made in this release of the package.</releaseNotes>
    <copyright>Copyright 2016</copyright>
    <files>
      <file src="bin\MyPackage.dll" target="C:\LocalPackageRepository" …
Run Code Online (Sandbox Code Playgroud)

.net nuget nuget-package

6
推荐指数
1
解决办法
9759
查看次数

标签 统计

.net ×1

nuget ×1

nuget-package ×1