I created the c# application, and the target framework is version 4.5.2. The program runs as an exe file and a dll file without installation. Users who do not have version 4.5.2 will get an error when running. When I run the exe file, how can I install the framework as shown below?
Asked
Active
Viewed 145 times
0
-
`without installation` <- this is the problem. During installation the check might be performed to verify required framework is available in machine for application to be run. – Renatas M. Nov 26 '18 at 10:56
-
Then use publish. To run an application on anther PC the same version of Net needs to be installed (including updates) or you need to publish the application which adds all the necessary windows dlls to run application. – jdweng Nov 26 '18 at 11:02
-
The .NET framework itself requires an installation if not already there, so for 100% portable programs .NET might not be the best of platforms. Either use a framework version included in every possible final user system or use another non.NET language. – Alejandro Nov 26 '18 at 11:02
-
Yes, you could make a simple C++ app that checks if dot net is installed, if it is then run the C# app else download dot net. – string.Empty Nov 26 '18 at 11:08
-
This particular dialog is used on a recent machine, like Win10, that no longer installs .NET 3.5 by default. They do try to get programmers to keep moving ahead. A missing .NET 4.x dialog ought to [resemble this](https://stackoverflow.com/a/10033128/17034). Don't help too much, I haven't yet seen it go wrong at SO. – Hans Passant Nov 26 '18 at 13:03
-
I eventually solved it by creating a Windows Installer project and specifying the prerequisites. Thank you all :) – mateatdang Nov 28 '18 at 02:02
1 Answers
1
You can use Publish in the Project Properties, under Publish tab. From here you can define the pre-requisites for your application and specify if they should be automatically downloaded if the user does not have them.

Ross Miller
- 656
- 3
- 9