Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 1.33 KB

File metadata and controls

34 lines (23 loc) · 1.33 KB
title NuGet Error NU1015
description NU1015 error code
author zivkan
ms.author zivkan
ms.date 06/04/2025
ms.topic reference
f1_keywords
NU1015

NuGet Error NU1015

Scenario

The following PackageReference item(s) do not have a version specified: Contoso.Utilities

Issue

Your project file, or a file it imports (for example Directory.Build.props) has defined a PackageReference without a version.

Projects using Central Package Management (CPM) do not define a version on the PackageReference item, so this error could happen if a project has CPM disabled by accident, or if a project or PackageReference using CPM is copied into another solution that is not using CPM.

Solution

  • Add a version to the package reference

If you edit your project, a package reference will generally look similar to <PackageReference Include="Contoso.Utilities" Version="1.2.3" />, although MSBuild allows multiple syntaxes to define item metadata. Add the Version="1.2.3" item metadata as defined.

  • Check Central Package Management configuration

This NU1015 error only happens when CPM is disabled. If Central Package Management (CPM) is intended to be enabled, check your configuration files to investigate why it is disabled.