简体   繁体   English

Visual Studio 未在生成时创建 nuget package

[英]Visual Studio not creating nuget package on build

I have a class library targeting net471 and I have set up the information in Properties->Package .我有一个针对net471的 class 库,我已经在Properties->Package中设置了信息。 Generate nuget package on build is also checked. Generate nuget package on build也被选中。

I'm also trying to create package manually by right-clicking on the project and selecting Generate nuget package .我还尝试通过右键单击项目并选择Generate nuget package

When I build the project, no package is created.当我构建项目时,没有创建 package。

Am I missing something?我错过了什么吗?

Note: I'm using the latest version of Visual Studio Community 2017 (15.6.2)注意:我使用的是最新版本的 Visual Studio Community 2017 (15.6.2)

The csproj and the following section which should be deleted: csproj和以下应删除的部分:

<ItemGroup>
  <PackageReference Include="NuGet.Build.Packaging" Version="0.1.227" />
</ItemGroup>

Once this is deleted, creating nuget packages works. 删除后,即可创建nuget包。

I had this problem because we'd made some changes to be able to create temporary packages.我遇到这个问题是因为我们做了一些更改以便能够创建临时包。

If you have the tag <PackageVersion> inside your csproj file, you need to update this value to the new version number (or remove the tag).如果您的 csproj 文件中有标签<PackageVersion> ,则需要将此值更新为新版本号(或删除标签)。

The UI doesn't change this tag's value, so you have to go via the XML (VS2019). UI 不会更改此标记的值,因此您必须通过 XML (VS2019) 更改为 go。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM