Warn user about .NET Framework requirements

So, I have an application (tool) that uses .NET 3.0. When run on a machine that has only .NET 2.0 installed (for example, the default installation of Server 2008 R2), it fails.

What I have seen so far is that people use a shunt, which will first check the .NET version. Is there any way to create it or add some manifest so that the user is warned about this problem (and, I hope, it will be suggested to install .NET)?

I know this can be solved by the installer, but I have requirements that require it to be a standalone executable. (Well, it's hard to explain, but it is related to the device driver. The tool comes with a driver, but the user should not force .NET 3.0 to install if they do not use this tool.)

I just need to stop at the point where the critical message “failed with exception message 0xe0434f4d” and at least give the user some idea of ​​what happened.

+4
source share
2 answers

We did not test this, but this article about structure detection tells you how you can detect the version of the framework from the code. I am not sure where your application fails, and if such checks can solve your problem, but if you cannot use it in your application, perhaps you can create a small “start-up application” in old .net 2.0 that performs these checks and that either tells the user to update or launch your "real" application?

As I said, I did not check this approach, it just is not in my power.

+4
source

It never makes any sense to me. Where do you stop? Do you also make sure that the user is not installing it on Windows 98? Does the machine have enough RAM? Does the user account have enough privileges?

Software vendors publish system requirements. You always specify the lowest supported version of Windows, the minimum amount of RAM, the required disk space, the minimum version of the browser, etc. This list also contains the minimum version of the .NET Framework. The purpose of this list is clear: do not expect it to work properly if you do not meet the requirements. If you do, this is your problem, not mine.

This is different for a consumer application. But when you install the Windows 2008 server, you are not writing a consumer application.

+4
source

Source: https://habr.com/ru/post/1305203/


All Articles