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.

Unable to restore 'Microsoft.NETCore.App >= 2.0'

See original GitHub issue

Steps to reproduce

Install the dotnet core normally

dotnet new console

Expected behavior

An application to be created

Actual behavior

Errors in /home/…/hwapp/hwapp.csproj Unable to resolve ‘Microsoft.NETCore.App (>= 2.0.0-preview2-25309-07)’ for ‘.NETCoreApp,Version=v2.0’.

Searching on nuget (https://www.nuget.org/packages/Microsoft.NETCore.App) I can see that the version 2.x is a pre release version, but I did not find any way of restore pre release dependency via dotnet restore

Environment data

dotnet --info output:

.NET Command Line Tools (2.0.0-preview2-006065)

Product Information:
 Version:            2.0.0-preview2-006065
 Commit SHA-1 hash:  7f50f322d5

Runtime Environment:
 OS Name:     deepin
 OS Version:  15.4
 OS Platform: Linux
 RID:         debian.8-x64
 Base Path:   /opt/dotnet/sdk/2.0.0-preview2-006065/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0-preview2-25309-07
  Build    : 41f5fc94eedc889f086800c23f35bf14a8c75a9f

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

14reactions
livarcocccommented, May 14, 2017

You can also add a NuGet.Config to your repo like this:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <!--To inherit the global NuGet package sources remove the <clear/> line below -->
    <clear />
    <add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
    <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
  </packageSources>
</configuration>
1reaction
livarcocccommented, May 22, 2017

One is the version of the tools (the first version above). The other is the version of the runtime on which the tool (CLI) runs.

You don’t have the same version of the runtime that you are targeting.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to restore 'Microsoft.NETCore.App >= 2.0' #8249
This happens because our offline cache hasn't been updated yet to contain these packages. The offline needs to be updated by asp.net and...
Read more >
Unable to resolve 'Microsoft.NETCore.App (>= 2.0.0)' for '. ...
To fix this uninstall the nightly bits and installed the .NET Core Preview 1 SDK with VS2017 Preview. Additionally the ASP.NET and CoreFX...
Read more >
Unable to publish using target framework netcore3.1 and ...
I have desktop WPF app written in C# and using NetCore3.1. When I try to publish it to a folder, using target runtime...
Read more >
[error]Packages failed to restore in VSTS using .net core 2.0
Using .ASP.NET core template to create a build in VTST and running into error while system trying to GuNet Restore dependencies.
Read more >
NuGet Warning NU1605
Solution. To the project exhibiting the restore warning, add a package reference to the higher version of the package. In the example above,...
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