无法生成nuget软件包(.nupkg文件)
我有一个班级图书馆项目,可以正确构建和重建该项目。当我尝试为项目创建包装时,我会发现一个错误说:
The file 'C:\Users\Test\..\Debug\netstandard2.0\MyApi\MyApi.dll' to be packed was not found on the disk.
我的.csproj文件看起来像这样:
<Project Sdk = "Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<OutDir>$(DIstributionDir)</OutDir>
<ProductReferenceAssemblyInOutDir>true</ProductReferenceAssemblyInOutDir>
</PropertyGroup>
</Project>
我有版本v6.2.0的nuget.exe
I have a class library project and I can build and rebuild the project properly. When I try to create a pack for my project, I get an error saying :
The file 'C:\Users\Test\..\Debug\netstandard2.0\MyApi\MyApi.dll' to be packed was not found on the disk.
My .csproj file looks like this :
<Project Sdk = "Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<OutDir>$(DIstributionDir)</OutDir>
<ProductReferenceAssemblyInOutDir>true</ProductReferenceAssemblyInOutDir>
</PropertyGroup>
</Project>
I have the nuget.exe of version v6.2.0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据您的描述,我进行了一些测试以重现问题。
您可以在您的.csproj文件中添加


&lt; generatePackageOnBuild&gt; false&gt;/generatePackageOnBuild&gt;
标记。这是测试结果:
According to your description I make some test to reproduce the problem.
You can add


<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
inside the<PropertyGroup>
tag in your .csproj file.Here is the test result: