permissions problem createing a COM object in ASP.NET after upgrade to 2

  • Thread starter Robert Ginsburg
  • Start date
R

Robert Ginsburg

I am upgrading an existing .NET 1.1 project to 2.0. (yes the project
continues to work perfectly in 1.1). The project includes a reference to an
assembly that manages communication to several databases and COM objects.
Since we need to be able to update the COM objects, the COM interop is hand
coded and is "late bound". That is so say, the progID is interograted to
create the object and the instances of the object are invoked by
InvokeMethod. (see snippet below). The Activator.CreateInstance always
throws a COM 80070005 error (which is an access denied). The DCOM
permissions are set so that everyone and anyone (including anonymous, guest,
IUSR... etc) has local permission on the COM object. A VBScript test running
from the console will work fine, the .NET 1.1 site works fine. I have tried
putting the assembly in the GAC and playing with the trust level of the web
site, but no matter what combination I use, I get the error.


Any help or thoughts on the matter are appreciated.

-robert


// in the constuctor ask for permissions and get our type from our PROGID
constant
SecurityPermission oSP = new
SecurityPermission(SecurityPermissionFlag.UnmanagedCode);
oSP.Demand();
m_TMType = Type.GetTypeFromProgID(PROGID); // this works and returns a
correct type

// in the method call

try {
object oTMObject = Activator.CreateInstance(m_TMType); // this always
throws an error
object [] oParms = new Object[4];
oParms[0] = UserName;
oParms[1] = Password;
oParms[2] = bResult;
oParms[3] = bPWIsExpired;

ParameterModifier oByRefFlag = new ParameterModifier(4);
oByRefFlag[0]=false;
oByRefFlag[1]=false;
oByRefFlag[2]=true;
oByRefFlag[3]=true;

ParameterModifier[] oPMods= {oByRefFlag};
bReturn = (bool)
m_TMType.InvokeMember("TestUserCredentials",BindingFlags.InvokeMethod,null,oTMObject,oParms,oPMods,
null,null);
if (bReturn) {
bReturn = (bool) oParms[2];
PWIsExpired = (bool) oParms[3];
}
oTMObject = null;

}
catch(Exception ERR) {
System.Diagnostics.Debug.Write(ERR.Message);
}
return bReturn;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top