'dot net 4 vb.net program asks for dot net 3.5 to be installed
I have a vb.net program that I've set the target framework to dot net 4, but when I run it on a machine without dot net 3.5 (windows 8.1 machine with dot net 4.5.2 installed), it asks to install dot net 3.5 when my code gets to using a process to start a batch file.
I've tried re-targetting it to use dot net 4 full, but that hasn't helped, and I've used dotPeek to check the framework targetted and IL Disassembler, and they both only show dot net 4.
Any ideas?
Solution 1:[1]
It's possible that one of the libraries involved has a dependency on 3.5. Ensure that all assemblies are using the same .Net version.
Solution 2:[2]
Windows 8 does not include .NET 3.5 (include .NET 2.0 and 3.0) by default. But if the user is upgrading from Windows 7 to Windows 8, .NET Framework 3.5 is fully enabled. The user can make sure this feature is enabled by check in Program and Features.
These is list of steps that the user can do to check it :
How to enable .NET Framework 3.5
If your computer has no .NET 3.5 installed there is no CLR to start for your app. .NET 4.0 is not automatically used for your app because of potential compatibility issues. First test that your app does run with .NET 4.0 and then add this section to your app.config to tell the CLR to prefer running .NET 4.0 if present.
<configuration>
<startup>
<supportedRuntime version="v4.0.30319"/>
</startup>
</configuration>
Please check this answer
Solution 3:[3]
I've found the problem, the batch file called installutil.exe, and it was this that was causing the request for the dot net framework 3.5.
Once I copied over installutil.exe from the c:\windows\microsoft.net\framework\v4.xxxxxxx folder, the program then behaved itself.
Thanks for all the prompt responses though :-)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | CDove |
| Solution 2 | Community |
| Solution 3 | Ozymandius257 |
