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.

VS2017 Update breaks my dotnet CLI tool: The specified framework 'Microsoft.NETCore.App', version '1.0.5' was not found.

See original GitHub issue

From @AArnott on June 26, 2017 5:18

I haven’t changed my dotnet CLI tool project in a significant way, but it stopped working on old machines when built with newer builds of VS 2017.

A build made a while back on this commit works. But recently I build this commit and suddenly an Ubuntu 14 machine can’t run my dotnet CLI tool, giving this error:

The specified framework 'Microsoft.NETCore.App', version '1.0.5' was not found.
  - Check application dependencies and target a framework version installed at:
      /usr/share/dotnet/shared/Microsoft.NETCore.App
  - The following versions are installed:
      1.1.1
      1.0.4
  - Alternatively, install the framework version '1.0.5'.

I found that between the two releases, the dotnet-codegen.runtimeconfig.json file had changed in a subtle, yet evidently significant way. The new one requires 1.0.5:

{
  "runtimeOptions": {
    "framework": {
      "name": "Microsoft.NETCore.App",
      "version": "1.0.5"
    }
  }
}

Whereas the old release required 1.0.4.

My dotnet CLI tool project file has not changed between these two commits. And it specified a target framework of netcoreapp1.0.

The only thing I can guess is that AppVeyor is now using agents with newer versions of VS2017, and somewhere along the line the dotnet SDK decided to automatically target a newer version of CoreCLR such that what I build no longer works on Ubuntu machines with dotnet CLI 1.0.1 installed (e.g. Travis CI). This is causing build breaks in projects that I’m trying to update to the latest build of my dotnet CLI tool.

How can I force my project to target 1.0.4 again? Why the automatic, implicit upgrade in requirements for my tool? How would I install 1.0.5 if I wanted to do that?

Copied from original issue: dotnet/coreclr#12447

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
leecowcommented, Jun 28, 2017

@AArnott , @livarcocc - If you have already followed the steps at https://www.microsoft.com/net/core#linuxubuntu, installed the SDK and just need the 1.0.5 shared framework then:

sudo apt-get install dotnet-sharedframework-microsoft.netcore.app-1.0.5

Package names get much nicer with 2.0.

0reactions
dasMullicommented, Jun 27, 2017

A quick Bing search doesn’t turn up any modern docs.

I hate to be bashing Bing but a google search quickly tells me this is documented (vaguely) at in the main csproj reference: https://docs.microsoft.com/en-us/dotnet/core/tools/csproj#recommendations

Never have an explicit reference to the Microsoft.NETCore.App or NetStandard.Library metapackages via the <PackageReference> property in your project file. If you need a specific version of the runtime, you should use the <RuntimeFrameworkVersion> property in your project (for example, 1.0.4) instead of referencing the metapackage.

(which I now see contains a bug calling PackageReference a property)

The design for the version binding in 2+ is discussed and documented at https://github.com/dotnet/designs/issues/3

Read more comments on GitHub >

github_iconTop Results From Across the Web

It was not possible to find any compatible framework ...
Net Core 2.2 (x86) SDK is installed, I get following error after executing the command dotnet myapp.dll in Developer Command Prompt VS2017. It ......
Read more >
Troubleshoot .NET tool usage issues
Could not execute because the specified command or file was not found. Possible reasons for this include: * You misspelled a built-in dotnet...
Read more >
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 >
Announcing .NET Core Tools Updates in VS 2017 RC
Updated (4/2017): See Announcing .NET Core Tools 1.0 to learn about the final .NET Core Tools 1.0 release in Visual Studio 2017 RTM....
Read more >
Troubleshoot .NET Framework targeting errors
This article provides resolutions for MSBuild errors that might occur because of reference issues.
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