Currently I am working on a project that needs .NET 4.0 to work properly but when I configure the windows installer and try to install it is trying to install the latest version of .NET. So how can I configure the windows installer to install the .NET version on which the project was created. Also I would like to know how to include the Visual C++ Redistributable in my installer.
Asked
Active
Viewed 1,041 times
2
-
1.NET 4.0 is too old, you'll need a clean machine that boots XP to get that version installed. Volunteering to support such an old dog is pretty courageous, formal support ended a long time ago. Just don't do this, let your app itself ensure that a usable framework version is available. No help needed: https://stackoverflow.com/a/10033128/17034 – Hans Passant Feb 18 '18 at 11:39
1 Answers
5
When you create a setup project and add primary output of a project to the setup project, the setup project automatically detect dependencies including Microsoft .Net Framework. To see if the detected dependency is correctly what you need, you cam see the following locations:
First of all, right click on Dependencies and click on Refresh Dependencies.
Check prerequisites for your project:
- Right click on setup project and choose Properties.
- In Properties dialog, from the Configurations combo box choose the configuration, and repeat the following steps for both Debug and Release.
- Click on Prerequisites... button to open Prerequisites.
- In the Prerequisites dialog, check the desired .Net Framework version.
- Press OK and Make sure you repeat above steps for both Debug and Release.
Check Launch Conditions for your setup project:
- Right click on setup project and from View select Launch Conditions:
- Then under Launch COnditions node, select .Net Framework node and right click and select Properties Window.
- In Properties Window check the Version property for .Net Framework launch condition.

Reza Aghaei
- 120,393
- 18
- 203
- 398
-
To include the Visual C++ Run-time libraries, use the *Prerequisites* button described above in the answer. – Reza Aghaei Feb 18 '18 at 13:11