J
JJ
Hi all,
I am having problem in loading types from an assembly using reflection.
I am using:
1. Windows Server 2003 64-Bit
2. Microsoft .NET Framework 1.1
3. IIS 6.0
My application is an ASP.NET web application and this application can
be started with providing log-in credentials through a logon page.
These credentials are nothing but the users organizational network
userid/password. The application will impersonate the user by examining
the Active Directory, and then proceed. I am using the windows
authentication mode -- following are the entries of my web.config file:
<authentication mode="Windows"/>
<identity impersonate="true"/>
In IIS, I am using both "Integrated Windows Authentication" and
"Anonymous Access".
Also, my application pool uses "Local System" identity.
Now, after calling the Impersonate() method of the WindowsIdentity
class, I am loading an assembly (the assembly is NOT stored in GAC)
like:
Assembly a = Assembly.LoadFrom("myassembly.dll");
IMyType vType = (IMyType)Activator.CreateInstance(a.GetType("mytype",
false, true));
Now, when I run this application, depending on the user, two different
things happen:
Scenario 1: The userid that I pass in the logon screen is the userid of
a user who is a member of the administrators group of the web server.
Result: Works fine.
Scenario 2: The userid that I pass in the logon screen is the userid of
a user who is NOT a member of the administrators group of the web
server.
Result: Getting the following error:
One or more of the types in the assembly unable to load.
System.Reflection.Module.GetTypesInternal(StackCrawlMark& stackMark) at
System.Reflection.Assembly.GetTypes()
Can anyone suggest any remedy please?
Regards,
JJ
I am having problem in loading types from an assembly using reflection.
I am using:
1. Windows Server 2003 64-Bit
2. Microsoft .NET Framework 1.1
3. IIS 6.0
My application is an ASP.NET web application and this application can
be started with providing log-in credentials through a logon page.
These credentials are nothing but the users organizational network
userid/password. The application will impersonate the user by examining
the Active Directory, and then proceed. I am using the windows
authentication mode -- following are the entries of my web.config file:
<authentication mode="Windows"/>
<identity impersonate="true"/>
In IIS, I am using both "Integrated Windows Authentication" and
"Anonymous Access".
Also, my application pool uses "Local System" identity.
Now, after calling the Impersonate() method of the WindowsIdentity
class, I am loading an assembly (the assembly is NOT stored in GAC)
like:
Assembly a = Assembly.LoadFrom("myassembly.dll");
IMyType vType = (IMyType)Activator.CreateInstance(a.GetType("mytype",
false, true));
Now, when I run this application, depending on the user, two different
things happen:
Scenario 1: The userid that I pass in the logon screen is the userid of
a user who is a member of the administrators group of the web server.
Result: Works fine.
Scenario 2: The userid that I pass in the logon screen is the userid of
a user who is NOT a member of the administrators group of the web
server.
Result: Getting the following error:
One or more of the types in the assembly unable to load.
System.Reflection.Module.GetTypesInternal(StackCrawlMark& stackMark) at
System.Reflection.Assembly.GetTypes()
Can anyone suggest any remedy please?
Regards,
JJ