DotNet Core Target Framework Runtime Error

One of the common events in the new .Net Core is the crazy somewhat obscure errors that occur.  I was recently working with a Web API in Core.  When I created a publish profile for the API, I got this error:

So it looks like everything is falling apart.  Next I copied the following into Google to see if I can stumble onto a quick fix:

Can not find runtime target for framework '.NETCoreApp,Version=v1.0' compatible with one of the target run times:

After reading several posts on Stack Overflow, I discovered that the key to fixing this error is the fact that it’s looking for a specific run-time environment, and it was looking for “win7-x64”.  Inside my config.json file was no run-time environment and I had tried one of the Stack Overflow suggestions of adding this:

But the right run-time was this (which is listed in step 2 of the error message):

Which is exactly as it’s spelled in the error message.  I think the steps 1, 2 and 3 just add confusion to the error message, but that might be an error message for many possible problems and the compiler isn’t sophisticated enough to figure it out.  Anyway, here’s the Stack Overflow article describing how to fix this error:

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

 

Leave a Reply