When are referenced Assemblies loaded?
- by Daniel
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?