Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > permissions problem createing a COM object in ASP.NET after upgrade to 2

Reply
Thread Tools

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

 
 
Robert Ginsburg
Guest
Posts: n/a
 
      01-02-2006
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.Unmanage dCode);
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",Bindin gFlags.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;








 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
createing directories and moving files into it Bee Tard Ruby 5 11-09-2008 04:05 PM
Createing a httpmodule to log IIS Mick Walker ASP .Net 2 10-29-2007 02:03 PM
Createing new ASP.Net application using VB and VS2005 ScottB ASP General 1 02-20-2006 02:22 PM
File security weirdness createing file. =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= ASP .Net 5 12-29-2005 01:39 AM
createing a *char with malloc but its giveing me too much space Gizmo C Programming 8 08-29-2003 06:35 PM



Advertisments