Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I wrote a program that makes a reference to Microsoft.Web.Administration.dll, which is not present on Windows Server 2003.

The program checks for the os and does not reference the dll if the os is 2003.

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>

When I tested this program on Windows Server 2003, an error occured telling me it couldn't locate the Microsoft.Web.Administration.dll.
But when I separated the if-else block into 2 different methods as below, and the error did not occur.

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

So I wanted to know about reference file loading time in more detail. could you point me to some resources?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
440 views
Welcome To Ask or Share your Answers For Others

1 Answer

When you enter a method that references a type in another assembly. Here is an example when trying to delay load x86 and x64 assemblies.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...