1

We have several machines running windows 10 which have suddenly started displaying errors when opening dotnet apps which previously worked. Amongst these is MSTeams but several apps on the same machines have all stopped working at the same time, so its an issue with windows and not the application itself. When you open the application it displays a message indicating

This application requires one of the following versions of the .NET framework: V4.0.30319

Windows 10 comes with .net4 installed so you obviously can't just reinstall it. In c:\windows\Microsoft.NET\Framework64\ I have a v4.0.30319 folder with what appears to be a valid .net installation. I've compared the folder with other machines and it looks ok.

If I execute the following Powershell

Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -Recurse | Get-ItemProperty -Name version -EA 0 | Where { $_.PSChildName -Match '^(?!S)\p{L}'} | Select PSChildName, version

it returns this:

    PSChildName                      Version
-----------                      -------
v2.0.50727                       2.0.50727.4927
v3.0                             3.0.30729.4926
Windows Communication Foundation 3.0.4506.4926
Windows Presentation Foundation  3.0.6920.4902
v3.5                             3.5.30729.4926
Client                           4.8.09037
Full                             4.8.09037
Client                           4.0.0.0

which, again, seems to be ok. The 4.8 version number varies on other machines

so, it looks like something has been modified which stops .net version detection from working as it should.

I've tried repairing via dism. KB5033910 is a CU for .net and win10 which I thought might reset things but apparently windows10.0-kb5033910-x64-ndp48_b1a3e722dbcd8d88b845314b8e9bf5e8fd9b6904.msu is not applicable to windows 10. Go figure.

Anyone seen this issue or know how .net is detected by apps compiled against .net?

EDIT: The MS tool CLRVER.exe returns the following output:

Microsoft (R) .NET CLR Version Tool  Version 4.8.9032.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Versions installed on the machine:
v2.0.50727
v4.0.30319

and if I enable .net activation logging via

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\CLRLoadLogDir

Then when I run the dfsvc.exe tool then resulting log indicates

13904,209391.187,Parsing config file: c:\windows\Microsoft.NET\Framework64\v4.0.30319\dfsvc.exe.config
13904,209391.187,Config File (Open). Result:00000000
13904,209391.187,Config File (Read). Result:00000000
13904,209391.187,Found config file: c:\windows\Microsoft.NET\Framework64\v4.0.30319\dfsvc.exe.config
13904,209391.187,UseLegacyV2RuntimeActivationPolicy is set to 0
13904,209391.187,Config file includes SupportedRuntime entry.  Version: v4.0, SKU: client
13904,209391.187,Found a supportedRuntime tag in the config file
13904,209391.187,ERROR: None of the listed supported runtimes are installed on the machine or can be used to satisfy this request.
5
  • .NET Framework on Windows 10 and 11 is handled via Windows Updates (including Optional) and that works for me. Try doing all Windows Updates and see if that helps. What can be included for .NET 4 is in the updates.
    – anon
    Commented Jan 12 at 16:18
  • Is Windows fully updated, including these apps? Seems like you have a mix of newer .NET Framework with older apps.
    – harrymc
    Commented Jan 12 at 16:44
  • .NET Framework 4 cannot as it’s literally impossible to install on any version of Windows 10 or Windows 11 as it already has .NET Framework 4.8.1 installed which cannot be uninstalled. kb5033910 is a Windows 10 1607 update which most definitely not 22H2
    – Ramhound
    Commented Jan 12 at 16:48
  • You are looking for this update but it’s likely already installed
    – Ramhound
    Commented Jan 12 at 16:53
  • yeah, I know, while it used to be possible to remove and reinstall to fix this type of problem. Just to give you an idea of how messed up this is. If I execute "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\dfsvc.exe -?", it responds with " This application requires one of the following versions of the .NET Framework: client Do you want to install this .NET Framework version now?". Given that the path is for the latest version, it would seem that detection of installed version is failing for some reason.
    – Ian
    Commented Jan 14 at 17:24

2 Answers 2

2

I solved this myself but not exactly in a satisfactory way. Nothing I did with repairing .net 4 had any effect whatsoever. As a last resort I tried just exporting hklm\software\Microsoft.netframework and hklm\software\wow6432node\microsoft.netframework on a machine which was working. On the problem machine I imported the first of these two files and everything went back to normal.

I haven't tried investigating exactly which registry setting was screwing this up but it wasn't necessary to import the wow6432node branch. This only affected a couple of machines so I don't have any more to experiment on. If anyone else sees this and works out what the exact setting was, I'd be interested.

I should also mention that I used Roger Zanders Reg2CI tool to export the registry settings to a Powershell script. A straight .reg file may have worked just fine.

-1

Copying the registry entries from a working machine is one way of resolving the core issue, which appears to be removed registry items from a recent .NET related installation. Here is a link to a full set of what registry items should be present, which worked for me:

https://techcommunity.microsoft.com/t5/windows-server-for-it-pro/windows-server-2019-and-net-4-8/m-p/3840420/highlight/true#M9922

Essentially, you need to add the following to a text file and import it to the registry:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0,Profile=Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.1]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.1,Profile=Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.2]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.2,Profile=Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.3]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.3,Profile=Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.5]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.5.1]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.5.2]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.5.3]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.6]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.6.1]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.6.2]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.7]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.7.1]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.7.2]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\Default]

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319]
"AspNetEnforceViewStateMac"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0,Profile=Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.1]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.1,Profile=Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.2]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.2,Profile=Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.3]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0.3,Profile=Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.5]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.5.1]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.5.2]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.5.3]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.6]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.6.1]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.6.2]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.7]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.7.1]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.7.2]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\Client]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\Default]
1
  • Any idea why this was downvoted? It similar to my own solution but contains far fewer registry entries. If I see the issue again I'll try this out but it seems like a perfectly reasonable answer and doesn't warrant a downvote.
    – Ian
    Commented Jun 9 at 21:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .