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.

Always get latest Microsoft.NETCore.App after restore

See original GitHub issue

I updated my dotnet cli yesterday and the version I got is 1.0.0-rc2-002464.

But today, when I wanted to create and build a project, it always failed.

The dependencies node in project.json.

"dependencies": {
    "Microsoft.NETCore.App": {
      "type": "platform",
      "version": "1.0.0-rc2-3002464"
    }
  }

Is there a way to tell the dotnet cli only get the dependencies in the exactly same version which is declared in project.json instead of latest version?

Steps to reproduce

  1. Run dotnet new
  2. Add NuGet.config per https://github.com/dotnet/cli/issues/2545
  3. Run dotnet restore
  4. Run dotnet build
  5. Run dotnet run

Expected behavior

Run the application after build without problem

Actual behavior

Restore warning: warn : Dependency specified was Microsoft.NETCore.App (>= 1.0.0-rc2-3002464) but ended up with Microsoft.NETCore.App 1.0.0-rc2-3002468.

Build warning: warning NU1007: Dependency specified was Microsoft.NETCore.App >= 1.0.0-rc2-3002464 but ended up with Microsoft.NETCore.App 1.0.0-rc2-3002468.

Run error: Expected to load libhostpolicy.dylib from [/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.0-rc2-3002468] This may be because the targeted framework [“Microsoft.NETCore.App”: “1.0.0-rc2-3002468”] was not found.

Environment data

dotnet --info output: .NET Command Line Tools (1.0.0-rc2-002464)

Product Information: Version: 1.0.0-rc2-002464 Commit Sha: 8313400465

Runtime Environment: OS Name: Mac OS X OS Version: 10.11 OS Platform: Darwin RID: osx.10.11-x64

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
717009629commented, Apr 22, 2016

我之前试了试 ,如果改成2400 他就会下大于或等于 2400的, 如果改成2450就会下大于或等于2450的。 这个版本小于你安装的netcore版本 ,编译和运行都没问题 ,大于就不行了

2reactions
717009629commented, Apr 22, 2016

应该是服务器上没有对应版本,就取了一个比他略大的版本,试试把1.0.0-rc2-3002464 改得小一点 ,比如1.0.0-rc2-3002400,这样应该就能编译了

Read more comments on GitHub >

github_iconTop Results From Across the Web

Started to get "This project is targeting a version of .NET ...
I'm getting this same issue with ASP.Net Core 3.1. The solution has been fine for two years and now it want's to install...
Read more >
Build error of ASP.NET Core - "...current settings, version ...
The project was restored using Microsoft.NETCore.App version 2.0.7, but with current settings, version 2.0.0 would be used instead.
Read more >
Deploying an ASP.NET core application with Elastic Beanstalk
In this tutorial, you will walk through the process of building a new ASP.NET Core application and deploying it to AWS Elastic Beanstalk....
Read more >
Solution to Visual Studio 2022 messing up ...
After an hour googling and tweaking I found the solution here VS2022 RC Install messed up my Android Xamarin projects in VS2019.
Read more >
Why isn't my ASP.NET Core app in Docker working?
This left me with one obvious answer - build my own CentOS Docker image, and install ASP.NET Core in it "manually". Creating the...
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