This application requires one of the following versions of .NET Framework
Asked Answered
P

5

16

I am trying to migrate our application to the newer version of .NET Framework. From current version of 4.5 to 4.6.1

Reason, why we are migrating to version 4.6.1 instead of 4.7 or 4.6.2 is, that most of our users and developers do have Windows 10 November update and based on information from .NET Framework System Requirements, .NET Framework 4.6.1 should be preinstalled in this version of Windows by default. This would leave us without any needs for users to download any kind of update.

The problem we are facing is, that every time we run our application following error message is displayed:

This application requires one of the following versions of .NET Framework: .NETFramework,Version=v4.6.1

Do you want to install this .NET Framework version now?

I have also checked what version of .NET Framework is listed in registry following MSDN's article: How to: Determine Which .NET Framework Versions Are Installed

The Registry value is 394806 which should actually be even .NET Framework 4.6.2

Any ideas how to solve this issue and what may cause it? I do not want users to be forced to install the update as it should be part of OS anyway.

Picrotoxin answered 29/5, 2017 at 7:44 Comment(1)
Just a heads-up: The November version will reach end of life in September this year, and will not receive any updates (including critical security updates) after that date.Politi
R
23

We recently came across a similar problem. When starting a service, we received the error "This application requires one of the following versions of .NET Framework:"

We discovered the issue was our misunderstanding of how to update the app.config file.

We had changed the app.config file to set <supportedRuntime version="v4.7" sku=".NETFramework,Version=v4.7" />

But should have set it to <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7" />

We had incorrectly set the major version of .NET as explained in https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/startup/supportedruntime-element#version

Reichenberg answered 28/7, 2017 at 18:36 Comment(0)
L
6

In case someone else encounters this, I had a similar problem with a windows service that wouldn't start due to an allegedly missing version 4.6 of the .NET framework. In my case, due to copy and paste, the following had happened in the config file:

<supportedRuntime version="v4.0" sku=".NETFramework, Version = v4.6"/>

whereas the following works:

<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>

So, the spaces are the culprit and must not be there! Why I don't know, because you'd expect the parser to be a little less picky, but ok...

Lorenzetti answered 16/4, 2019 at 7:52 Comment(0)
K
4

I had this same error today with SourceTree after applying a new Windows Insider version, with the difference that SourceTree was requiring 4.7.1.

I found that the version number was correct as 4.0 but, based on @Skyler Nesheim's answer, I changed the other attribute, sku, from being
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1" /> to be
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> and that made it work.

Kaifeng answered 7/9, 2018 at 11:52 Comment(0)
W
1

In case anyone else runs into this with 4.7.2 and none of the other solutions work: The solution that worked for us was to update to 4.7.3 on the offending servers (the service itself can of course still target 4.7.2).

Waldner answered 19/5, 2020 at 16:43 Comment(0)
D
1

This application requires one of the following versions of .NET Framework: .NETFramework,Version=v4.6.1

Do you want to install this .NET Framework version now?

Someone found the fix for this issue, you can check it here :

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

All you have to do is paste the full code in Notepad as "All files" type with a .reg at the end, open regedit, then in the File tab, press Import and select the saved Notepad file.

Note: I understand that this is a very late answer, but i'm posting this on all the first results on Google.

Democratic answered 4/4 at 4:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.