加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

.net – 何时引用了Assemblies加载?

发布时间:2020-12-14 01:51:39 所属栏目:Windows 来源:网络整理
导读:我写了一个程序,引用了Microsoft.Web.Administration.dll, 在 Windows Server 2003上不存在. 程序检查操作系统,如果操作系统是2003,则不引用dll. if(OSVersion == WindowsServer2003) //do the job without referencing the Microsoft.Web.Administration.br
我写了一个程序,引用了Microsoft.Web.Administration.dll,
在 Windows Server 2003上不存在.

程序检查操作系统,如果操作系统是2003,则不引用dll.

if(OSVersion == WindowsServer2003)
    //do the job without referencing the Microsoft.Web.Administration.<br>
else if(OSVersion == WindowsServer2008)
   //reference the Microsoft.Web.Administration.dll file.<br>

当我在Windows Server 2003上测试此程序时,发生错误告诉我它无法找到Microsoft.Web.Administration.dll.
但是当我将if-else块分成如下2种不同的方法时,并没有发生错误.

if(OSVersion == WindowsServer2003)
   //do the job without referencing the Microsoft.Web.Administration.<br>
else if(OSVersion == WindowsServer2008)
   //DoIt2008Style();

所以我想更详细地了解参考文件加载时间.
你能指点我一些资源吗?

解决方法

当您输入引用另一个程序集中的类型的方法时. Here是尝试延迟加载x86和x64程序集时的示例.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读