MikeJansen
MikeJansen

Reputation: 3476

How to generate a non-.NET Core Library NuGet package within Visual Studio 2017

If I create a .NET Core Class Library in Visual Studio 2017, I get the Package tab on project properties. If I create an "old fashioned" Class Library, I do not get the Package tab, nor the "Pack" target in MSBuild.

NuGet is integrated into VS2017 and MSBuild to some degree, but it seems to be only for .NET Core projects.

Is there a way to use any of the NuGet integration for non-.NET Core projects or do I just need to install the NuGet CLI and use a .nuspec file?

Upvotes: 1

Views: 395

Answers (1)

Martin Ullrich
Martin Ullrich

Reputation: 100751

This support for integrated packaging needs "SDK-style" csproj files which are used for .NET Core and .NET Standard projects. Since a few features (like some designers) aren't yet available for these projects, there are no templates for "SDK-style" csproj-based projects for .NET Standard.

However, you can create a .NET Standard project and change the csproj file from

<TargetFramework>netstandard1.6</TargetFramework>

to a net* moniker like

<TargetFramework>net461</TargetFramework>

This gives you all the tooling for creating NuGet packages and managing versions and metadata.

Upvotes: 2

Related Questions