"You must install .NET Desktop Runtime to run this application"

Larry C 20 Reputation points
2024-09-23T16:53:00.3566667+00:00

image

I am writing an .nsi script, which after successfully installing, will not allow me to run the program after showing the popup in the screenshot above "You must install .NET Desktop Runtime to run this application". I have clicked the Learn more link**: **https://learn.microsoft.com/en-us/do...atible-runtime I followed the suggestions in the link above: - When I run 

dotnet --list-runtimes

I have Microsoft Windows Desktop Runtime - 8.0.8 (x64) installed as 

Microsoft.WindowsDesktop.App 8.0.8

  • all of the .csproj's are targeting the same Windows 10 net 8.0 framework.

<TargetFramework>net8.0-windows10.0.20348.0</TargetFramework>

I've uninstalled and reinstalled .NET Desktop Runtime 8.0.8 several times and it hasn't fixed the issue. I've rebuilt the .nsi script and re-ran the installation. I can't seem to get a solution for this, does anyone have any suggestions? ​

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,833 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,156 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jiachen Li-MSFT 31,166 Reputation points Microsoft Vendor
    2024-09-24T01:22:41.69+00:00

    Hi @Larry C ,

    Ensure that there are no conflicts with other .NET installations. Clearing out older or conflicting .NET runtimes:

    1. Remove unnecessary .NET versions via the Windows Apps & features settings.
    2. Check for environment variables that may affect the detection of the correct runtime, especially DOTNET_MULTILEVEL_LOOKUP and DOTNET_ROOT.

    Best Regards.

    Jiachen Li


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.