Forum Discussion
.NET runtime issues - application not starting up
Hello,
We have a .NET based application built using the .NET framework 8.0. The application runtimeconfig.json file shows this:
MyApp.runtimeconfig.json
"tfm": "net8.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
{
"name": "Microsoft.WindowsDesktop.App",
"version": "8.0.0"
}
],
Please note that we have Published the application and verified that only .NET version 8.0.16 components, DLLs etc are required. Anything higher than this does not show up.
From the cmd prompt, the following runtimes are shown to be installed on the system:
>dotnet --list-runtimes
Microsoft.AspNetCore.App 8.0.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
However, when we try to start a Windows service which is installed as part of the application, it does not start up, and the Windows Event Viewer shows the following error:
"Description: A .NET application failed.
Application: MyAppControllerService.exe
Path: C:\MyApp\MyAppControllerService.exe
Message: You must install or update .NET to run this application.
App: C:\MyApp\MyAppControllerService.exe
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '8.0.21' (x64)
.NET location: C:\Program Files\dotnet\
The following frameworks were found:
8.0.20 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Learn more:
https://aka.ms/dotnet/app-launch-failed
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=8.0.21&arch=x64&rid=win-x64&os=win10"
So, the issue is, even with Microsoft.WindowsDesktop.App 8.0.20 being installed on the system, it still asks for the .NET 8.0 Runtime (v8.0.21) to be installed. Please let me know why this is so?
Since, as per this:
https://learn.microsoft.com/en-us/dotnet/core/install/windows
.NET Desktop Runtime includes the .NET runtime as well, and Microsoft.WindowsDesktop.App 8.0.20 is installed.
Thanks in advance,
JY
1 Reply
- atakankulOccasional Reader
Hello,
This issue is caused by a version mismatch in the runtime environment.
If you have manually changed the path referencing the runtime or have manually selected a different SDK version during setup, it can be difficult to fix the confusion afterward.
To avoid any lingering complexity and ensure the Windows Service finds the correct version, the easiest and fastest solution is to uninstall the SDK completely and then reinstall it from scratch.
This will resolve any path conflicts and ensure your system locates the necessary runtime version.