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.1Do 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.
asked May 29, 2017 at 7:44
1
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
answered Jul 28, 2017 at 18:36
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…
answered Apr 16, 2019 at 7:52
obarteltobartelt
511 silver badge2 bronze badges
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.
answered Sep 7, 2018 at 11:52
Eugenio MiróEugenio Miró
2,3802 gold badges31 silver badges38 bronze badges
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).
answered May 19, 2020 at 16:43
NateNate
316 bronze badges
- Remove From My Forums
-
Question
-
So yesterday my computer started to act up. It was behaving normally before this and I’m not quite sure what happened. Many programs as well as background processes bring up error messages on launch saying:
This application requires one of the following versions of the .NET Framework:
.NETFramework,Version=v4.0
Do you want to install this .NET Framework version now?
I click yes and it opens up a browser page that automatically downloads the .NET Framework version. However, when I try to install it says:
Your installation will not occur. See below for reasons why.
Details
.NET Framework 4.6.1 or a later update is already installed on this computer.
If it’s already installed, why are multiple programs and processes not functional? I’ve looked everywhere on google but can’t seem to find a working solution to my problem. I’ve tried finding and deleting the different .NET Framework versions, but
this error message still pops up. (I feel like doing this caused many more problems than I originally had.)Please help?
Answers
-
You can check to see if your .NET Framework 4.0 is OK with this tool:
http://blogs.msdn.com/b/astebner/archive/2008/10/13/8999004.aspx
Run the tool with .NET 4.0 selected, then check the last few lines of the tool log for the test app return code. If the return code is 0, your .NET 4.0 is correctly installed and configured.
If the return code is not 0, the framework is corrupt and will have to be repaired. Repair procedures vary depending on your Windows version, so please share the version with us.
-
Proposed as answer by
Monday, December 28, 2015 2:01 AM
-
Marked as answer by
宝宝徐
Monday, January 4, 2016 6:47 AM
-
Proposed as answer by
-
-
Proposed as answer by
宝宝徐
Tuesday, December 29, 2015 8:48 AM -
Marked as answer by
宝宝徐
Monday, January 4, 2016 6:47 AM
-
Proposed as answer by
Содержание
- Что делать? Устанавливать или нет?
- this application requires a java runtime environment (different POV) #238
- Comments
- dhamann commented Jul 20, 2020 •
- aahlenst commented Jul 20, 2020
- hendrikebbers commented Jul 20, 2020
- dhamann commented Jul 20, 2020
- hendrikebbers commented Jul 20, 2020
- hendrikebbers commented Jul 20, 2020
- hendrikebbers commented Jul 20, 2020
- dhamann commented Jul 20, 2020
- dhamann commented Jul 20, 2020
- aahlenst commented Jul 21, 2020
- douph1 commented Jul 21, 2020
- dhamann commented Jul 21, 2020 •
- dhamann commented Jul 21, 2020 •
- dhamann commented Jul 21, 2020
- douph1 commented Jul 21, 2020
- douph1 commented Jul 21, 2020
- douph1 commented Jul 21, 2020
- dhamann commented Sep 13, 2020 •
- aahlenst commented Sep 14, 2020
- ttimasdf commented Feb 24, 2021 •
Что делать? Устанавливать или нет?
При запуске приложения Snaz вместо приложения, выскакивает табличка:
This application requires one of the following versions of the .NET
Framework:
.NETFramework,Version=v.4.5.2
Do you want to install this .NET Framework version now?
При нажатии ДА, перекидывает на сайт и скачивается программа NDP462-KB3151802-Web.exe
Что делать если эта ошибка? Предупреждения:
Программа установки может не работать надлежащим образом, поскольку на этом компьютере недоступна служба Центра обновления Windows.
Что делать если эта ошибка? Предупреждения:
Программа установки может не работать надлежащим образом, поскольку на этом компьютере недоступна служба Центра обновления Windows.
Что делать если эта ошибка? Предупреждения:
Программа установки может не работать надлежащим образом, поскольку на этом компьютере недоступна служба Центра обновления Windows.
Что делать если эта ошибка? Предупреждения:
Программа установки может не работать надлежащим образом, поскольку на этом компьютере недоступна служба Центра обновления Windows.
ТОЛЬКО СЕГОДНЯ И ТОЛЬКО ДЛЯ ТЕБЯ ПЕРЕВОЖУ ТЕКСТ В ОНЛАЙН ПЕРЕВОДЧИКЕ БЕСПЛАТНО.
This application requires one of the following versions of the .NET
Framework:
.NETFramework,Version=v.4.5.2
Do you want to install this .NET Framework version now?
Для этого приложения требуется одна из следующих версий .NET
Фреймворк:
.NetFramework, Version = v.4.5.2
Вы хотите установить эту версию .NET Framework сейчас?
Источник
this application requires a java runtime environment (different POV) #238
TL;DR: How to handle registry magic when using zip distribution? (for example after installing via scoop installer)
I do not know where to address my question (am aware this repo is for the installer), please be kind if you think this is the wrong place. i am open to recreating this issue somewhere else seen better fitting. but as i found the personally most fitting issue in this repo that is handling technicalities concerning the openjdk windows registry stuff i thought i post this issue here.
With issue #64 you created a way to use the installer to handle the registry magic . which is great! only i do not use the manual installer but use scoop to install java. scoop does not use the msi installer but extracts the zipped distribution . is there a way to reproduce the things the installer does concerning creation of the the required registry entries?
If there currently is no way . could the functionality be transformed to a utility that could be distributed inside the zipped distribution?
The text was updated successfully, but these errors were encountered:
JAVA_HOME is an environment variable an can be set using the GUI. Enter «environment variable» into the search field of Windows and the right option should pop up. The registry entries can be created manually using regedit. See https://docs.oracle.com/javase/9/install/installation-jdk-and-jre-microsoft-windows-platforms.htm#JSJIG-GUID-47C269A3-5220-412F-9E31-4B8C37A82BFB for the entries common Java software expects.
I assume setting JAVA_HOME is not the part that was asked here. If I understand @dhamann correctly he wants to add the JAR mimetype to be executed by Java for example. Is that right?
hi both of you, @aahlenst you are thinking in the right direction, @hendrikebbers you too!
. actually i would like to be able to do the stuff the installer does to the registry by running a utility that sets the values for the version that is distributed with the zip file.
running a jar via doubleclick is one use case, another would be running an executable file generated by launch4j
@aahlenst i probably would need to do the stuff you pointed me to . for every installed java version and for every next coming update again? how do other people using the zipped distribution handle this? (please point me to a better target for my question if the openjdk-installer repo is a not fitting place for this, i just do not know where to ask)
Is scoop like home-brew for windows? The project has 11k stars on GitHub. Maybe we should think about providing a script for scoop?
Looks like this is already available: https://github.com/ScoopInstaller/Java
Maybe the scripts just do not everything that the installer does. Looks like it sets the JAVA_HOME env but does no windows registry mutations: https://github.com/ScoopInstaller/Java/blob/master/bucket/adopt11-hotspot.json
ScoopInstaller/Scoop#3412 Scoop does not provide registry support at the moment.
hmm . i just tried it with the current installer . and it is like i want everything except the root node 🙂
would it be possible to put all the sub-entries of the root node in a second node that just sets the configuration? It could use the path supplied like shown in the screenshot below (i just painted that as a suggestive idea, the current dialog is also shown BELOW for reference)
Idea for different Dialog (two root nodes):
Current Dialog (one root node):
JAVA_HOME is an environment variable an can be set using the GUI. Enter «environment variable» into the search field of Windows and the right option should pop up. The registry entries can be created manually using regedit. See https://docs.oracle.com/javase/9/install/installation-jdk-and-jre-microsoft-windows-platforms.htm#JSJIG-GUID-47C269A3-5220-412F-9E31-4B8C37A82BFB for the entries common Java software expects.
hi @aahlenst the supplied info in the deep link is probably just the tip of the iceberg, i suppose? would i not also need some kind of reg entry for the directory that this keys point to? orcl url sadly does not mention anything like that there
dear @douph1 please excuse my «pulling you in» by mentioning . i read your very informative comments (for example: #64 (comment)) . currently the installer executes logic to manipulate registry values directly, right? (via wix-tooling?)
Could the installer maybe also create windows cmd / batch files that make it possible to re-execute that same registry-setting commands for the specific version? (although I just peeked into douph1@c79c7e8 and that seems rather complicated 🙂 ) Thank you for putting your time into this solution there, btw. Seems really challenging to find «the right» solution!
I’m not yet sure what the exact problem is. Therefore it is hard to recommend something and even more so to take action.
What do you want to achieve? Beyond applying «registry magic» to the ZIP files? Do you need multiple Java versions and an easy way to switch between them? Why is using an MSI not an option?
To write «Oracle Java Key» you must write to
HKLM only ( be root required )
The key path is based on :
- Major version (1.8 or later)
- JRE vs JDK
- know if you use Wow > Wow6432Node
But a key must not be overridden with an older key ( always pointed to the latest/newest Java )
As it depends of the version intended to be installed and already installed, just write reg key without the binary is useless and or/copy/paste reg key from one host to another is a bad idea.
.jar and .jnlp apply to HKMU (switches between hklm and hkcu depending on machine or user installation)
.jnlp apply only to Java 8
Adding/splitting the installer features in two groups will break actual feature level compatibility. So no
You can probably use a tool to monitor wich reg key is written by the installer
https://docs.microsoft.com/en-us/sysinternals/downloads/procmon
and then extract this key as registry patch
or create a list of command with https://docs.microsoft.com/fr-fr/windows-server/administration/windows-commands/reg-add
I’m not yet sure what the exact problem is. [. ]
Reproducing the windows registry settings that get set by the installer after having extracted (either by hand or by using a tool like scoop) the zip-distribution.
What do you want to achieve? [. ] Do you need multiple Java versions and an easy way to switch between them?
Why is using an MSI not an option?
it is an option. i can do it via the installer. i thought there might already exist a way to have every needed jdk installed and switch the windows registry settings separately.
To write «Oracle Java Key» you must write to
[. ]
[. ]
.jnlp apply only to Java 8
@douph1 thank you for all the input!
Adding/splitting the installer features in two groups will break actual feature level compatibility. So no
snap, i liked the idea 🙂
yes, that is what i tried yesternight . i tried to use a tool called regshot, which produced a bit too much noise (many background regchanges also in delta result) . hmm .
would you maybe be able to suggest relevant reg-branches i should monitor for changes, @douph1 ? I currently built the following reg-file . and am trying now to switch the current version. But i probably have not grasped the picture well enough.
but what about [HKLMSOFTWAREWOW6432NodeJavaSoft]? Do i need both? (Win10 Pro x64)
I am starting to fear this rabbit hole.
A batch file supplied with the zip distro that sets the right entries is probably also too complicated?
//last edit: please excuse the edit-storm. it has ended now.
i re-read the commandline parameter section of https://adoptopenjdk.net/installation.html#windows-msi and tried a different angle (and already thought bad of me not having thought of that before)
I tried to omit the FeatureMain option when calling the msi-installer . so for example:
could maybe have done everything except installing files to target dir. But that did not produce the envisioned result.
uh this is hard.
but what about [HKLMSOFTWAREWOW6432NodeJavaSoft]? Do i need both? (Win10 Pro x64)
no. it is intended for Java 32 on Win 64
Your title «this application requires a java runtime environment» seems linked to «launch4j»
and as mentionned in #64 launch4j can but don’t rely on JAVA_HOME by default.
By default it look only onto JavaSoft
so you must look/create (depending of the java version)
«CurrentVersion» on
- HKEY_LOCAL_MACHINESoftwareJavaSoft JRE
or/and - HKEY_LOCAL_MACHINESoftwareJavaSoft Java Runtime Environment (for 1.8)
and/or - HKEY_LOCAL_MACHINESOFTWAREJavaSoft JDK
and/or - HKEY_LOCAL_MACHINESOFTWAREJavaSoft Java Development Kit (for 1.8)
into a subkey corresponding to this «CurrentVersion»
create a key «JavaHome» with the JAVA_HOME ( = INSTALLDIR (without bin ) )
and eventually (but I don’t know if launch4j required it ) «RuntimeLib» if it is a JRE with the DllPath as here https://github.com/douph1/openjdk-installer/blob/master/wix/Includes/OpenJDK.Variables.wxi
and for file association with exe you must certainly look at microsoft documentation if you intended to rewrite all the magic as Wix-installer does
Just to name a «magic» thing ..
https://stackoverflow.com/questions/51715292/best-way-to-get-file-type-association-in-windows-10-from-command-line
on systems running Windows 8 or later
..a new registry key was introduced and Windows now writes the user choice to
«UserChoice»
HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER
Both the «App Paths» and «Applications» registry subkeys are used to register and control the behavior of the system on behalf of applications. The App Paths subkey is the preferred location.
I’m even not sure if WIX/our usage of WIX installer use the new «App Paths» reg key
as I have already seen that .jar file association don’t work always.
After some weeks of inactivity i just re-read the whole thread and with this issue still being open i feel a bit of «something to do left» . so i would like to mention the rather hidden question of «my opening post» and leave the action of closing or further working on/with something to you. (You could also ask me to close it if that is the way to go)
If you think that this (something executable that would be included in the zip distribution) would be something that might be creatable . should i create a new issue asking for relating to just that (and relating to this issue as documentation of the thought process)?
In my first post i asked
«. is there a way to reproduce the things the installer does concerning creation of the the required registry entries?»
and in hindsight i might have clarified that i was not thinking of crafting the reproduction myself but that something like an executable script (or something similar) already might exist that would be included in each zip distribution.
@douph1 thank you especially for the last three thorough replies! Via your input i now have a better understanding of the windows client side peculiarities of the jre/jdk installation. Or the challenges applications have to find out about the configured java binaries to run with.
Thanks, too, to everyone who took the time to inspect this Issue. 🙂
If you really want to, you can create a PowerShell or batch script that does the registry alterations. But why? If you want that kind of automation, the MSI has you covered and even provides multiple safeguards you had to re-implement in the script. With something like scoop in the mix, it gets really hairy because you need to remove/update those entries. This is something that has to be solved by the application that manages you JDK installations.
For the record: I don’t think it makes sense for scoop or a similar tool to use the MSIs. VS Code does it and judging by the bug reports we get here, this wasn’t the right choice. If your tool does version management of JDKs, let your tool handle the registry stuff.
I just do some reverse engineering to a 32 bit executable produced by java. In fact, it just iterate over a hardcoded list of Registry path and iterate the subkeys inside it. and any one of them exists, it will work. The CurrentVersion key is in fact not check at all. The executable check the subkey name as version string, that ANY version above 1.8.0_45 will work so I randomly choose 1.11
So, All I need is put the following content inside a javahome.reg file, and double click it. and all exes requiring java works smoothly from now on.
You may tweak it a bit to suit your scenario. My openJDK version is jre-15.0.2.7-hotspot . besides, 64 bit or 32 bit doesn’t matter at all, so don’t care about WOW6432Node
Part of the list that any java executable will checked through:
Источник
How do I fix the error that started popping up in a lot of applications:
To run this application, you first must install one of the following
version of the .Net Framework: v2.0.50727.Would you like to download an install version v2.0.50727 of the .NET framework now?
Unfortunately, this is not as simple as just installing the .NET 2.0 runtime, because its already installed. If I run the recommended installers for .NET 2.0 or .NET 3.5 SP1, it exits silently.
Events leading to problem:
- Installed SQL Server 2008 R2, which installs a toy version of Visual Studio 2008 that only deals with SQL specific projects.
- Uninstalled Visual Studio 2008.
asked Sep 21, 2012 at 12:32
5
I’ve often seen situations similar to this related to corruption in the installed .Net installation. Martineau’s suggestion of uninstalling and reinstalling the .Net is probably in the right ballpark.
You can get this error with the .Net still installed if the program throwing the error does not DETECT the installation. Uninstalling/reinstalling will help with that. After you’ve uninstalled the existing .Net package, you might read through this article about the most recent Cleanup utility from MS. If removal of some other application left corrupted system connections, you might need that cleanup in order to get your system back to rights.
answered Sep 24, 2012 at 19:04
0
Installing .net 4.0 solved a similar issue for me before. I don’t know why…
answered Mar 8, 2014 at 10:24
It would help if you specified which version of Windows this relates to.
You can check the Registry entries to see if the values applications should be using to verify which versions of the .NET Framework are installed have been corrupted.
If you are using a version of Windows for which .NET Framework 2.0 cannot be uninstalled, this article has some suggestions.
Glorfindel
4,0598 gold badges23 silver badges37 bronze badges
answered Sep 24, 2012 at 19:26
David MarshallDavid Marshall
7,1194 gold badges26 silver badges32 bronze badges
How do I fix the error that started popping up in a lot of applications:
To run this application, you first must install one of the following
version of the .Net Framework: v2.0.50727.Would you like to download an install version v2.0.50727 of the .NET framework now?
Unfortunately, this is not as simple as just installing the .NET 2.0 runtime, because its already installed. If I run the recommended installers for .NET 2.0 or .NET 3.5 SP1, it exits silently.
Events leading to problem:
- Installed SQL Server 2008 R2, which installs a toy version of Visual Studio 2008 that only deals with SQL specific projects.
- Uninstalled Visual Studio 2008.
asked Sep 21, 2012 at 12:32
5
I’ve often seen situations similar to this related to corruption in the installed .Net installation. Martineau’s suggestion of uninstalling and reinstalling the .Net is probably in the right ballpark.
You can get this error with the .Net still installed if the program throwing the error does not DETECT the installation. Uninstalling/reinstalling will help with that. After you’ve uninstalled the existing .Net package, you might read through this article about the most recent Cleanup utility from MS. If removal of some other application left corrupted system connections, you might need that cleanup in order to get your system back to rights.
answered Sep 24, 2012 at 19:04
0
Installing .net 4.0 solved a similar issue for me before. I don’t know why…
answered Mar 8, 2014 at 10:24
It would help if you specified which version of Windows this relates to.
You can check the Registry entries to see if the values applications should be using to verify which versions of the .NET Framework are installed have been corrupted.
If you are using a version of Windows for which .NET Framework 2.0 cannot be uninstalled, this article has some suggestions.
Glorfindel
4,0598 gold badges23 silver badges37 bronze badges
answered Sep 24, 2012 at 19:26
David MarshallDavid Marshall
7,1194 gold badges26 silver badges32 bronze badges