how check is .NET framework installed or not

岁酱吖の 提交于 2020-01-24 11:43:28

问题


I want to develop a .NET application in c# but first i need to check
that the .NET framework is installed , because i don't want user see any error.
so is there any vc++ code that only use MFC in a static Library to check if .NET framework is installed ?


回答1:


You can use the registry to check about .net framework and it's version, Either you you use VC++ or some other language that can handle registry..

Check Micrsoft Knowledge Base Article - How to determine which versions and service pack levels of the Microsoft .NET Framework are installed

There are various way suggested on SO thread.

Another one is using the Signum.Utilities library from SignumFramework (wich you can use stand-alone), you can get it nicely and without dealing with the registry by yourself.

Edit: Check this code project article - Is .NET Framework installed on this machine???, it is also using registry to get the framework installed or not..

Hope this help..




回答2:


  1. Check if the file MSCorEE.dll is present in the %SystemRoot%\System32 directory.
  2. Also the .Net Framework SDk includes a utility called CLRver.exe which shows versions of .Net framework installed on your machine


来源:https://stackoverflow.com/questions/10714331/how-check-is-net-framework-installed-or-not

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!