Skip to content

Latest commit

 

History

History
40 lines (26 loc) · 1.66 KB

File metadata and controls

40 lines (26 loc) · 1.66 KB
title NuGet Error NU1212
description NU1212 Error code
author nkolev92
ms.date 02/02/2022
ms.topic reference
f1_keywords
NU1212

NuGet Warning NU1212

Scenario 1

Invalid project-package combination for Contoso.Library 1.0.0. DotnetToolReference project style can only contain references of the DotnetTool type

Issue

DotnetToolReference project style can only reference .NET tools with the DotnetTool package type. Either the project style is not DotnetToolReference or a referenced package is not of DotnetTool type.

Solution

Projects of this style are normally not ordinary projects and the dotnet tool commands should be used to manage your dotnet tools. Contoso.Library is not a DotnetTool package. Use a different package that's of the DotnetTool type.

Scenario 2

Invalid project-package combination for Contoso.Library 1.0.0. DotnetToolReference project style can only contain references of the DotnetTool type

Issue

DotnetToolReference project style can only reference .NET tools with the DotnetTool package type. Either the project style is not DotnetToolReference or a referenced package is not of DotnetTool type.

Solution

Projects of this style are normally not ordinary projects and the dotnet tool commands should be used to manage your dotnet tools.

The project in question is not a DotnetToolReference project, but the package is of the DotnetTool type. Change the RestoreProjectStyle to DotnetToolReference.