R
Rob
Environment:
..NET 1.1
VS 2003
Scenario:
I have an app that is deployed with no-touch deployment. The initial
footprint of the app should be as small as possible,
loading/downloading assemblies only when they are needed.
The app (app.exe) consists only of a login form. When the user is
authenticated from the login form, then MyObject in MyDll.dll should
be loaded.
Sample code:
'Login() lives in app.exe, and MyDll.dll is referenced in the app.exe
project.
Private Sub Login()
...
If bUserIsAuthenticated Then
LoadMethod1()
Else
'Do something else
End If
...
End Sub
'LoadMethod1() also lives in app.exe
Private Sub LoadMethod1()
...
Dim myObj As New MyDll.MyObject 'MyDll should get loaded here.
...
End Sub
If I instantiate myObj in the Login method, then the class loader
loads the MyDll assembly, regardless of whether that line ever gets
executed. If I put it into its own method, then the class loader
defers the load until LoadMethod1 method is actually loaded. This is
expected.
So my issue is this: the above scenario works as expected when the
code is compiled on Win 2K Pro or XP machines (I can verify this by
looking in the download cache as the assemblies are downloaded during
NTD). When I compile it on Win 2K Server machines and run the
application, MyDll is loaded no matter what. The OS is seemingly the
biggest differentiating factor.
Thoughts?
Thanks,
Rob
..NET 1.1
VS 2003
Scenario:
I have an app that is deployed with no-touch deployment. The initial
footprint of the app should be as small as possible,
loading/downloading assemblies only when they are needed.
The app (app.exe) consists only of a login form. When the user is
authenticated from the login form, then MyObject in MyDll.dll should
be loaded.
Sample code:
'Login() lives in app.exe, and MyDll.dll is referenced in the app.exe
project.
Private Sub Login()
...
If bUserIsAuthenticated Then
LoadMethod1()
Else
'Do something else
End If
...
End Sub
'LoadMethod1() also lives in app.exe
Private Sub LoadMethod1()
...
Dim myObj As New MyDll.MyObject 'MyDll should get loaded here.
...
End Sub
If I instantiate myObj in the Login method, then the class loader
loads the MyDll assembly, regardless of whether that line ever gets
executed. If I put it into its own method, then the class loader
defers the load until LoadMethod1 method is actually loaded. This is
expected.
So my issue is this: the above scenario works as expected when the
code is compiled on Win 2K Pro or XP machines (I can verify this by
looking in the download cache as the assemblies are downloaded during
NTD). When I compile it on Win 2K Server machines and run the
application, MyDll is loaded no matter what. The OS is seemingly the
biggest differentiating factor.
Thoughts?
Thanks,
Rob