Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Can not find runtime target for framework .NETCoreApp=v1 compatible with one of the target runtimes

I am trying to migrate an Asp.Net Core RC1 project to RC2 and have been following this documentation and have also followed the instructions for DNX migration to .NET CLI.

I am getting the following error when I try dotnet run:

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:

The project has not been restored or restore failed -run 'dotnet restore'
The project does not list one of 'win10-x64, win81-x64, win7-x64' in the 'runtimes'

I have run dotnet restore and it seems to have completed successfully.

I have updated all the relevant packages to RC2.
by

2 Answers

Amit8z4mc
I received this error after updating VS2015 core template to 1.0.1. It was because I have a PCL that targets netstandard 1.4 if you don't want to have to specify each runtime, Just change the dependency markup for Microsoft.NETCore.App to this:
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.1"
}
pankajshivnani123
I received this error because I used the incredibly broken NuGet Package Manager in Visual Studio 2015 to update my project.json dependencies. It turned this:

"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.1"
}
}
}
}

into this:

"dependencies": {
"Microsoft.NETCore.App": "1.1.0"
},
"frameworks": {
"netcoreapp1.0": {}
}

Bye bye, platform definition!

Login / Signup to Answer the Question.