dotnet add package reference puts Version in an element
See original GitHub issueSteps to reproduce
dotnet new -t lib
dotnat add package Newtonsoft.json
Expected behavior
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.4</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1"/>
</ItemGroup>
</Project>
Actual behavior
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.4</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json">
<Version>9.0.1</Version>
</PackageReference>
</ItemGroup>
</Project>
Environment data
dotnet --info
output:
.NET Command Line Tools (1.0.0-rc4-004771)
Product Information:
Version: 1.0.0-rc4-004771
Commit SHA-1 hash: 4228198f0e
Runtime Environment:
OS Name: Windows
OS Version: 10.0.15025
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.0-rc4-004771
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:6 (6 by maintainers)
Top Results From Across the Web
dotnet add package command - .NET CLI
The 'dotnet add package' command provides a convenient option to add a NuGet package reference to a project.
Read more >PackageReference in project files - NuGet
Package references, using <PackageReference> MSBuild items, specify NuGet package dependencies directly within project files, as opposed to ...
Read more >Get nuget package version included in csproj in .Net Core 3.1
I am developing an application that replaces a nuget package with its actual project reference. This is application is used for debugging ...
Read more >Install and manage NuGet packages with the dotnet CLI
The dotnet add package command adds a package reference to the project file, and then runs dotnet restore to install the package.
Read more >Manage package dependencies in .NET - .NET CLI
This article explains how to add and remove package dependencies by editing the project file or by using the CLI. The <PackageReference> element....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing this one since we already have two issues tracking this.
dupe of: https://github.com/dotnet/cli/issues/5386 and https://github.com/NuGet/Home/issues/4325