Bad error message if Microsoft.NETCore.App isn't a "platform" in the project.json
See original GitHub issueSteps 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:
- Created 7 years ago
- Reactions:14
- Comments:28 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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”).
@wilfredogr the solution is to add
type: platform
to theMicrosoft.NETCore.App
dependency, like so: