我从我的项目创建了一个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>
在我的.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" />
</files>
</metadata>
</package>