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.

Bad error message if Microsoft.NETCore.App isn't a "platform" in the project.json

See original GitHub issue

Steps to reproduce

Create a new project/exe that uses the netcoreapp1.0 framework.

Add a dependency “Microsoft.NETCore.App”:“1.0.0-rc2-24015”

Expected behavior

A better error saying that the type needs to be a platform. The entry should be “Microsoft.NETCore.App”: { “version”: “1.0.0-rc2-24015”, “type”: “platform” } And that fixes the error correctly.

Actual behavior

Errors that suggest putting in RID’s

Severity    Code    Description Project File    Line    Suppression State
Error       Can not find runtime target for framework '.NETCoreApp,Version=v1.0' compatible with one of the target runtimes: 'win10-x64, win81-x64, win8-x64, win7-x64'. Possible causes:   Dapper.Tests    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets  241 
Error       1. The project has not been restored or restore failed - run `dotnet restore`   Dapper.Tests    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets  241 
Error       2. The project does not list one of 'win10-x64, win81-x64, win8-x64, win7-x64' in the 'runtimes' section.   Dapper.Tests    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets  241 

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-rc2-002418)

Product Information: Version: 1.0.0-rc2-002418 Commit Sha: a8686e58fc

Runtime Environment: OS Name: Windows OS Version: 10.0.14316 OS Platform: Windows RID: win10-x64

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:14
  • Comments:28 (4 by maintainers)

github_iconTop GitHub Comments

58reactions
Tgeocommented, Sep 21, 2016

Hopefully this helps someone, I ran into this error message after upgrading some nuget packages in an ASP.NET Core project.

My project.json file had this line before nuget upgrade: "Microsoft.NETCore.App": { "version": "1.0.1", "type": "platform" }

Then after upgrade, that line was removed and this was added: "Microsoft.NETCore.App": "1.0.1"

Since this now doesn’t list the platform (the focus of this GitHub issue), you just need to revert the newly added line to the previous block (with the “type”: “platform”).

15reactions
blackdwarfcommented, Dec 23, 2016

@wilfredogr the solution is to add type: platform to the Microsoft.NETCore.App dependency, like so:

"Microsoft.NETCore.App": {
    "type": "platform",
    "version": "1.1.0"
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Bad error message if Microsoft.NETCore.App isn't ...
Steps to reproduce Create a new project/exe that uses the netcoreapp1.0 framework. Add a dependency "Microsoft.NETCore.
Read more >
Troubleshoot ASP.NET Core on Azure App Service and IIS
A common failure condition is the app is misconfigured due to targeting a version of the ASP.NET Core shared framework that isn't present....
Read more >
Common error troubleshooting for Azure App Service and ...
Provides troubleshooting advice for the most common errors when hosting ASP.NET Core apps on Azure Apps Service and IIS.
Read more >
NETSDK1045: The current .NET SDK does not support ...
This error occurs when the build tools can't find the version of the .NET SDK that's needed to build a project. This is...
Read more >
Improving .NET host error messages and supportability
Have you ever tried to launch a .NET app and seen an error message telling you that you are missing a runtime, like...
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