【发布时间】:2012-06-08 08:09:12
【问题描述】:
我可以使用 .Net4 RegAsm.exe 对 .NET 2 dll 执行 RegAsm 吗?
我的机器上只安装了 .NET 4,我需要对 .NET 2 文件执行 RegAsm。
【问题讨论】:
标签: .net .net-4.0 registry regasm
我可以使用 .Net4 RegAsm.exe 对 .NET 2 dll 执行 RegAsm 吗?
我的机器上只安装了 .NET 4,我需要对 .NET 2 文件执行 RegAsm。
【问题讨论】:
标签: .net .net-4.0 registry regasm
是的,你可以。写入注册表的 RuntimeVersion 值将根据 CLR 标头设置(即,即使您使用 4.0 RegAsm 注册 2.0 DLL,它也会“知道”它是 2.0 DLL 并相应地注册)。
【讨论】:
System.Runtime.InteropServices.RegistrationServices.RegisterAssembly和相关行-string imageRuntimeVersion = assembly.ImageRuntimeVersion;-是有的。