I have created a WPF application which should natively run on Windows 7, 8, 8.1, 10.
In Visual Studio, I have set .NET Framework to 3.5 as it is bundled with Windows 7. When I run it on Win10, however, it prompts to install .NET 3.5 as Win10 is bundled with 4.6 and does not have 3.5 installed by default.
How can I make my application run on all Windows versions >= 7 without getting any prompts from Windows and without installing anything?
NET framework 3.5 in Windows 10. Download the file, extract it from the ZIP archive to the Desktop, right click it and choose Run as administrator. The file will install . NET Framework 3.5 automatically after finding the drive letter of your Windows 10 installation media.
It is essential for users to install and enable . NET 3.5 in their Windows system. To determine whether . NET 3.5 Framework is installed, users can check the path:C:\Windows\Microsoft.NET\Framework64 to see whether they can find the folder v3.
IT CAN WORK, found the solution:
We need to modify app.config file and put below lines in it:
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
<supportedRuntime version="v4.0"/>
<supportedRuntime version="v2.0.50727"/>
</startup>
It decides from top to bottom, whichever first version of .net is found as per above list it works on that.
CATCH: After building, a ProgramName.exe.config file is made in release folder, we need to copy it with our ProgramName.exe to the system in which we want to run..
You can create an installer that installs your app + .NET 4.5 to client's computer silently. That way your app will run seamlessly on every OS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With