简体   繁体   English

警告.NET Framework要求的用户

[英]Warn user of .NET Framework requirements

So I have an app (tool) that uses .NET 3.0. 所以我有一个使用.NET 3.0的应用程序(工具)。 When run on a machine that only has .NET 2.0 (like the default Server 2008 R2 install) it crashes miserably. 当在仅具有.NET 2.0的计算机上运行时(如默认的Server 2008 R2安装),它会崩溃。

What I've seen so far is that people are using a shunt that will first check the .NET version. 到目前为止我所看到的是人们正在使用首先检查.NET版本的分流器。 Is there a way to build it or add some manifest somehow so that the user is warned of this problem (and hopefully be prompted to install .NET)? 有没有办法构建它或以某种方式添加一些清单,以便警告用户这个问题(并希望提示安装.NET)?

I know this can be solved by an installer, but I have requirements that need it to be a standalone executable. 我知道这可以通过安装程序解决,但我有要求需要它是一个独立的可执行文件。 (Ok this is hard to explain, but it's related to the a device driver. The tool comes with the driver, but the user shouldn't be forced to install .NET 3.0 if they won't use the tool.) (好的,这很难解释,但它与设备驱动程序有关。该工具附带驱动程序,但如果用户不使用该工具,则不应强制用户安装.NET 3.0。)

I just need to stop at the point where a cryptic "application has failed with exception 0xe0434f4d" message and at the very least give the user some idea of what happened. 我只需要停留在一个神秘的“应用程序失败并出现异常0xe0434f4d”消息的位置,并且至少让用户知道发生了什么。

Have not tested this, but this article about framework detection tells how you could detect the framework version from code. 没有测试过,但是这篇关于框架检测的文章说明了如何从代码中检测框架版本。 I'm not sure where your application fails and if injecting checks like this could solve your problem, but if you cannot use this in your app, you could perhaps create a small "starter app" in old .net 2.0 that performs these checks and then either tells the user to upgrade or starts your "real" app? 我不确定你的应用程序在哪里失败,如果注入这样的检查可以解决你的问题,但如果你不能在你的应用程序中使用它,你可能会在旧的.net 2.0中创建一个小的“启动应用程序”来执行这些检查,那么要么告诉用户升级还是启动你的“真实”应用程序?

As I said, haven't tested this approach, it's just off the top of my mind. 正如我所说,没有测试过这种方法,它只是我的头脑。

This never makes any sense to me. 这从来没有对我有任何意义。 Where are you going to stop? 你要去哪儿? Are you going to make sure as well that the user doesn't install it on Windows 98? 您是否还要确保用户不在Windows 98上安装它? That the machine has enough RAM? 机器有足够的RAM吗? That the user account has enough privileges? 用户帐户有足够的权限吗?

Software vendors publish system requirements. 软件供应商发布系统要求。 You always quote the lowest supported Windows version, minimum amount of RAM, required disk space, minimum browser version, etc. Minimum .NET framework version belongs in that list too. 您始终引用支持的最低Windows版本,最小RAM量,所需磁盘空间,最小浏览器版本等。最低.NET框架版本也属于该列表。 The intention of this list is clear: don't expect it to work properly if you don't meet the requirements. 此列表的目的很明确:如果您不满足要求,请不要期望它正常工作。 If you do it anyway, it is your problem, not mine. 无论如何,如果你这样做,这是你的问题,而不是我问题。

This is different for a consumer-level app. 这对于消费者级别的应用程序是不同的。 But when you install to Windows 2008 server, you are not writing a consumer app. 但是,当您安装到Windows 2008服务器时,您不会编写消费者应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 警告用户在重定向到https之前启用TLS-ASP.net - Warn user to enable TLS prior to redirecting to https - ASP.net XP中的简单Windows表单应用程序和.NET框架要求 - Simple Windows form app and .NET framework requirements in XP 如何在ASP.NET Core MVC中输入表单时警告用户 - How to warn the user during form input in ASP.NET Core MVC 如果用户尝试进入 FSM 中的未定义状态,为什么 Akka.Net 不会发出警告? - Why doesn't Akka.Net warn if the user tries to go to an undefined state in a FSM? 如何中断下载并警告用户? - How to interrupt download and warn user? .NET框架库是否被视为用户定义的? - Are the .NET framework libraries considered to be user-defined? .net 框架中用户脚本的受控执行 - Controlled execution of a user script in .net framework 如果由于在ASP.NET MVC 4应用程序的应用程序池中设置的空闲超时而导致应用程序超时,我们如何警告用户 - How can we warn the user if the application timeouts due to Idle-timeout set in the application pool of an ASP.NET MVC 4 app ClaimTypes 的 ASP.NET 要求 - ASP.NET requirements for ClaimTypes 警告级别不显示log4net - Warn level not show log4net
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM