How to Check .net framework version installed

本文提供了两种检查计算机上是否已安装指定版本的.NET Framework的方法。方法一涉及注册表路径检查,通过验证特定文件的存在来确认运行时安装状态;方法二则通过加载库文件并调用特定API来判断。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Method   1:

1.)   Under   HKLM/SOFTWARE/Microsoft/.NETFramework/policy/   check   to   see   if   the   version   you   want   is   installed   (for   example,   look   for   the   v1.1   folder   and   4322   for   the   version   number   to   detect   the   released   version   of   V1.1)

2.)   Under   HKLM/Software/Microsoft/.NETFramework/InstallRoot   get   the   path   where   the   Framework   is   installed.   Create   a   directory   string   by   concatenating   the   install   root   and   the   version   under   policy.   E.g.   "C:/WINDOWS/Microsoft.NET/Framework/ "   +   "v1.1 "   +   ". "   +   "4322 "

3.)   Look   at   the   directory,   if   mscorlib.dll   (or   another   critical   .dll   to   the   .NET   framework   is   there)   the   runtime   is   installed.

 

Method   2:  

There 's   a   caveat   to   this   method   in   that   the   shim   gets   left   behind   when   we   uninstall   if   there   is   more   than   one   version   of   the   CLR   on   the   machine,   but   it   still   can   be   useful   depending   on   what   version   you 're   looking   for:

LoadLibrary(“mscoree.dll“);   -   if   this   fails   then   there 's   no   runtime   installed

GetProcAddress(“CorBindToRuntime“);   -   if   this   fails   there 's   no   runtime   installed

CorBindToRuntime(“GetRequestedRuntimeInfo“);  

GetRequestedRuntimeInfo(xxxx);   where   xxxx   is   the   build   number.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值