Re: COM DLL works fine in C# but not when using Remoting

From: Sam Santiago (ssantiago_at_n0spam-SoftiTechture.com)
Date: 08/06/04


Date: Fri, 6 Aug 2004 15:40:50 -0700

I thought you were hosting your remote server in IIS for some reason. You
might want to post some stub code here to see then. Most of the references
to that error number seem to be security related though in MS KB or Google
newsgroup search. As a test you might want to set a given Identity for you
COM+ application to run under as a test so that you can rule out the passing
of security credentials as a cause. To do this, in Component Services, look
at your COM+ application properties and set the Identity to a specific user.
Security might not be involved at all, but it's worth ruling out.

Thanks,

Sam

-- 
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
http://www.SoftiTechture.com
_______________________________
"SARA" <SARA@discussions.microsoft.com> wrote in message
news:13C43879-FFA9-4EB4-9F3C-DA82A0A59EA3@microsoft.com...
> I am not using ASP.NET or XML Web Services at this time.  I have a regular
C#
> client trying to call the function on the remote object.  My client, MBR
> Class and server are on the same machine in the same folder.  Everything
> works fine when I call other functions on my ISession object that return
> strings.
>
> "Sam Santiago" wrote:
>
> > Sounds like a security problem.  The user your request ends up running
as
> > does not have rights to instantiate a COM object.  Check out this link:
> >
> > Implementing Impersonation in ASP.NET
> > http://support.microsoft.com/default.aspx?scid=kb;EN-US;306158
> >
> > And this posting to the newsgroup from last year:
> >
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=e28I%23B3pDHA.708%40TK2MSFTNGP10.phx.gbl
> >
> > Thanks,
> >
> > Sam
> >
> > -- 
> > _______________________________
> > Sam Santiago
> > ssantiago@n0spam-SoftiTechture.com
> > http://www.SoftiTechture.com
> > _______________________________
> > "SARA" <SARA@discussions.microsoft.com> wrote in message
> > news:45EA1241-5983-4DFB-800E-4AD85B67F92B@microsoft.com...
> > > Thanks for the quick response.
> > >
> > > That is how I had it set up.  I had the Session objectt declared as
> > private.
> > >  I had a public function called connect().  Inside the connect()
function
> > I
> > > was calling Session.Connect(Arg).  Should the Arg object also be a
private
> > > member?  Currently, I am creating a local object and passing it to the
> > > Session.Connect(Arg) function.
> > >
> > > Here's the exact exception I am getting:
> > >
> > > Unhandled Exception: System.Runtime.InteropServices.COMException
> > > (0x80010105): The server threw an exception.
> > >
> > > Server stack trace:
> > >    at TestClientLib.ISession.Connect(Arg pConnectParam)
> > >    at TestNameSpace.TestRemote.connect() in
> > > c:\MyWebServices\Test.NET\TestRemote.cs:line 68
> > >    at
> > >
> >
System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(Met
> > hodBase
> > > mb, Object[] args, Object server, Int32 methodPtr, Boolean
> > fExecuteInContext,
> > > Object[]& outArgs)
> > >    at
> > >
> >
System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessa
> > ge msg, Int32 methodPtr, Boolean fExecuteInContext)
> > >
> > > Exception rethrown at [0]:
> > >    at
> > System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
> > > reqMsg, IMessage retMsg)
> > >    at
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
> > > msgData, Int32 type)
> > >    at TestNameSpace.TestRemote.connect() in
> > > c:\MyWebServices\Test.NET\TestRemote.cs:line 48
> > >    at TestNameSpace.RemoteClient.Main(String[] args) in
> > > c:\MyWebServices\Test.NET\RemoteClient.cs:line 22
> > >
> > > "Sunny" wrote:
> > >
> > > > In article <F5C59F91-4C09-49A8-8FDF-7A64CA6FABE4@microsoft.com>,
> > > > SARA@discussions.microsoft.com says...
> > > > > Greetings All:
> > > > >
> > > > > I have a COM DLL that works perfectly fine in a C# program.
However,
> > if I
> > > > > move the same code to a class that inherits from MarshalRefObj I
get
> > an
> > > > > exception and I can not call the same function that I call
correctly
> > if I do
> > > > > not use Remoting.  The function in question is called Connect(Arg)
in
> > a class
> > > > > called Session.  I can call other functions in the Session class
and
> > teh Arg
> > > > > class that return string args.  However, the Connect(Arg) function
> > fails and
> > > > > throws System.Runtime.InteropServices.COMException.
> > > > >
> > > > > I am new to the .NET technology and I have tried searching the
> > newsgroups
> > > > > for this but have not found anything.
> > > > >
> > > > > I was curious to know what I am doing wrong.
> > > > >
> > > > > SARA
> > > > >
> > > > >
> > > >
> > > > Hi Sara,
> > > >
> > > > create the COM object as private in your MBR class. Then expose to
the
> > > > clients a wrapper methods, which in turn will call the COM object's
> > > > methods.
> > > >
> > > > Sunny
> > > >
> >
> >
> >


Relevant Pages

  • security-basics Digest of: get.123_145
    ... VPN to ASP a security risk? ... Re: Multiple IPSec tunnels? ... Subject: Security NT Server ... VPN to ASP a security risk? ...
    (Security-Basics)
  • << SBS News of the week - Sept 26 >>
    ... And he points to the info you need to put the file on the server in the ... at the network perimeter. ... The Symantec Firewall/VPN and the Gateway Security ... by the firewall at risk. ...
    (microsoft.public.backoffice.smallbiz)
  • << SBS News of the week - Sept 26 >>
    ... And he points to the info you need to put the file on the server in the ... at the network perimeter. ... The Symantec Firewall/VPN and the Gateway Security ... by the firewall at risk. ...
    (microsoft.public.backoffice.smallbiz2000)
  • Re: << SBS News of the week - Sept 26 >>
    ... > And he points to the info you need to put the file on the server in the ... > at the network perimeter. ... The Symantec Firewall/VPN and the Gateway Security ... An attacker can exploit these flaws in tandem via specially ...
    (microsoft.public.backoffice.smallbiz2000)
  • << SBS News of the week - Sept 26 >>
    ... And he points to the info you need to put the file on the server in the ... at the network perimeter. ... The Symantec Firewall/VPN and the Gateway Security ... by the firewall at risk. ...
    (microsoft.public.windows.server.sbs)