question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet add package reference puts Version in an element

See original GitHub issue

Steps 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:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
livarcocccommented, Feb 9, 2017

Closing this one since we already have two issues tracking this.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found