TL;DR: Run the latest available .NET Core SDK setup from here
Detailed Explanation: When I was trying to run a simple .NET Core console application below error was shown in output window and the application wasn't starting:
The program '[11036] dotnet.exe' has exited with code -2147450749
(0x80008083).
Then I went to \bin\Debug\netcoreapp1.1\ path of my application code and started a PowerShell window from that path. Then I tried launching the application from console with below command:
dotnet .\myapp.dll
which gave below error:
It was not possible to find any compatible framework version The
specified framework 'Microsoft.NETCore.App', version '1.1.2' was not
found.
- Check application dependencies and target a framework version installed at:
\
- Alternatively, install the framework version '1.1.2'.
Then I realized that Visual Studio wasn't showing the actual error in the output window which would have been more useful to me.
So that ring some bells. Then, I ran below command
dotnet --version
This gave me the version of highest .NET Core version installed on my machine. It returned :
2.0.3
I also checked C:\Program Files\dotnet\sdk directory and it contained below directories:
1.0.0-preview2-003131
1.0.0-preview4-004233
1.0.4
1.1.0
Here folder 1.1.2 is missing required by my application to run. So, I ran the latest available .NET Core SDK setup from here to repair it. There are two parts of the setup:
- Microsoft .NET core 1.0.5 runtime
- Microsoft .NET core Windows Server hosting
The second part is crucial to solving the error we're facing. It requires that IIS feature is enabled on your machine as a prerequisite. So enable IIS feature before you get started with the installer.
So running and finishing the installer setup resolved my issue.