Re: COM DLL works fine in C# but not when using Remoting
From: SARA (SARA_at_discussions.microsoft.com)
Date: 08/06/04
- Next message: Sam Santiago: "Re: COM DLL works fine in C# but not when using Remoting"
- Previous message: Sam Santiago: "Re: COM DLL works fine in C# but not when using Remoting"
- In reply to: Sam Santiago: "Re: COM DLL works fine in C# but not when using Remoting"
- Next in thread: Sam Santiago: "Re: COM DLL works fine in C# but not when using Remoting"
- Reply: Sam Santiago: "Re: COM DLL works fine in C# but not when using Remoting"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 6 Aug 2004 09:59:03 -0700
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
> > >
>
>
>
- Next message: Sam Santiago: "Re: COM DLL works fine in C# but not when using Remoting"
- Previous message: Sam Santiago: "Re: COM DLL works fine in C# but not when using Remoting"
- In reply to: Sam Santiago: "Re: COM DLL works fine in C# but not when using Remoting"
- Next in thread: Sam Santiago: "Re: COM DLL works fine in C# but not when using Remoting"
- Reply: Sam Santiago: "Re: COM DLL works fine in C# but not when using Remoting"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|