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.