Bob Vesterman
Bob Vesterman

Reputation: 1211

Making Framework (not Core, not Standard) NuGet packages with VS2017

If I make a .NET Core or .NET Standard project using VS2017, and open the project's properties, there's a "Package" tab, which includes a checkbox labeled "Generate NuGet package on build". But there's no such tab if it's a .NET Framework project.

Am I missing something here? Or for a Framework project, do I have to go through the whole manual nuspec/pack/blah blah rigamarole?

Upvotes: 0

Views: 57

Answers (1)

Leo Liu
Leo Liu

Reputation: 76720

Making Framework (not Core, not Standard) NuGet packages with VS2017

That is because the .NET Framework project still use the old project type (Non-SDK), the Package tab is only supported by new project type(SDK).

If you want to use the Package tab for library .NET Framework project, you can convert your project from the old .csproj to new .csproj, (Right click your project->Unload project->Edit .csproj. Replace the contents of your csproj with the following:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net46</TargetFramework>
  </PropertyGroup>
</Project>

Note: Need to delete the AssemblyInfo.cs file in the Properties.

See Old csproj to new csproj: Visual Studio 2017 upgrade guide for more info about convert old .csproj to new .csproj.

Then you will get the package tab for .NET Framework project:

enter image description here

Hope this helps.

Upvotes: 1

Related Questions