关于.NET运行多个版本



 



 



当主程序编译结果是.NET Framework4.5



 






 
 
 
 
 
 
 
 
 
 
 
 







 







The 
DevExpress.XtraEditor.dll如果出厂时,是在.NET Framework2.0环境下编译出来的,能否在上述环境下运行?猜想的可能是如下:



 



1.      
主程序激活对应版本的CLR, 如上例子是激活.NET Framework4.0,



2.      
主程序在调用DevEpress.Data.dll, 照样将其装入Process space.



3.      
DevExpress.Data.dll调用其依赖项dll



DevExpress.Data.dll是在.NET Framework2.0环境下编译的, DevExpress.Data.dll具体调用时候,会检查dll-Meta中的依赖项,比如.



.assembly extern System



{



 .publickeytoken
= (B7 7A 5C 56 19 34 E0 89 ) 



 .ver 2:0:0:0



}



.assembly extern System.Configuration



{



 .publickeytoken
= (B0 3F 5F 7F 11 D5 0A 3A )   



.ver 2:0:0:0



}



依具体dll.NET
Framework版本,装载对应版本的dll到同一个process空间运行。



 



这样就允许不同.NET
Framework版本的dll“混合运行”在同一个.NET Framework Runtime中。



 



 



 



CLRVer.exe – to tell .NET Framework
versions installed on your machine.



 



The CLR loading process:



1.      
All managed module and assembly
must use the Windows portable executable(PE)file format and be either Exe or
dll.



2.      
CLR be implemented as a COM
server contained inside a dll.



3.      
After windows examined the ExE
file’s header to determine whether to create 32-process, a 64bit process, or
WoW64 process, windows loads the the corresponding version of MSCorEE.dll into
the process address space.



4.      
The process primary thread
calls the method defined in MSCorEE.dll, and initializes the CLR



5.      
Loads the EXE assembly, Calls
the exe’s Main method.



 



 



 



 



转载于:https://www.cnblogs.com/Solar/archive/2011/12/20/2294173.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值