Re: .Net Remoting impass. Please help!

From: Nicholas Paldino [.NET/C# MVP] (mvp_at_spam.guard.caspershouse.com)
Date: 10/15/04


Date: Fri, 15 Oct 2004 10:47:13 -0400

Skip,

    Check out the section of the C# faq titled "How can I subscribe to
events exposed by a remoted object?", located at (watch for line wrap):

http://blogs.msdn.com/csharpfaq/archive/2004/04/28/122691.aspx

    There is an explanation of how to get events to fire over remoting, as
well as links to samples.

    Hope this helps.

-- 
               - Nicholas Paldino [.NET/C# MVP]
               - mvp@spam.guard.caspershouse.com
"Skip" <Skip@discussions.microsoft.com> wrote in message 
news:CDB83780-0CC2-4391-B43D-071B400B1C5A@microsoft.com...
> Hi,
>
> I get the following exception thrown when I try to run my code:
>
> "An unhandled exception of type
> 'System.Runtime.Serialization.SerializationException' occurred in 
> mscorlib.dll
>
> Additional information: Because of security restrictions, the type
> System.Runtime.Remoting.ObjRef cannot be accessed."
>
> Now, I did read an MS article (located here:
> http://blogs.msdn.com/sanpil/archive/2004/02/23/78754.aspx) and I have
> tried to implement the changes needed in my configuration files but to no
> avail.  I still get the same message.
>
> Here's a copy of my server side config file:
>
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
>  <system.runtime.remoting>
>    <application>
>      <service>
>        <wellknown
>          mode="Singleton"
>          type="SI_Remoting.RemoteMessage, SI_Remoting"
>          objectUri="RemoteServer.soap"
>        />
>      </service>
>      <channels>
>     <channel
>       ref="http"
>       port="33445"
>     />
>     <serverProviders>
>          <provider ref="wsdl"/>
>          <formatter
>            ref="soap"
>            typeFilterLevel="Full"
>          />
>          <formatter
>            ref="binary"
>            typeFilterLevel="Full"
>          />
>        </serverProviders>
>      </channels>
>    </application>
>  </system.runtime.remoting>
> </configuration>
>
> And here's a copy of the client's config file:
>
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
>  <system.runtime.remoting>
>    <application>
>      <client>
>        <wellknown
>          type="SI_Remoting.RemoteMessage, SI_Remoting"
>          url="http://localhost:33445/RemoteServer.soap"
>        />
>      </client>
>      <channels>
>        <channel
>          ref="http"
>          port="0"
>        />
>        <serverProviders>
>          <provider ref="wsdl"/>
>          <formatter
>            ref="soap"
>            typeFilterLevel="Full"
>          />
>          <formatter
>            ref="binary"
>            typeFilterLevel="Full"
>          />
>        </serverProviders>
>      </channels>
>    </application>
>  </system.runtime.remoting>
> </configuration>
>
> By the way, I also tried switching the "serverProviders" tags to
> "clientProviders" (every combination for the client/server was tried) 
> without
> any success.
>
> The code, otherwise, is pretty simple.  Only thing is that I'm passing a
> reference of the client to the server object in order to later on be able 
> to
> call one of it's procedures when some work has been done.  You can look at 
> my
> previous post (on oct. 7th 2004) for details on the code.
>
> Everything was done according to what's written in the article.  Why am I
> still getting this exception?  By the way, the application is running both
> the server and the client on the same machine for now so it shouldn't have
> anything to do with the network.
>
> Thanks,
>
> SC
> 


Relevant Pages

  • return from server only works for built-in types
    ... But when I call _r.GetStatisticsthe client fails with the exception shown ... GetStatistics fails when client and server is on different networks. ... Win32 Version: 2.0.50727.832 ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Assembly does not allow partially trusted callers
    ... (common on a shared server). ... > Modified the config file so debug=false ... > Exception Details: System.Security.SecurityException: That assembly ... > includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How to detect if client or server are not responding
    ... you are asking if raising an exception could cause a COM call not ... responds to the server crashing. ... client implemented in an ActiveX plugin DLL running in a browser. ... If a COM service crashes in the middle of a call, it may take up to 6 ...
    (microsoft.public.win32.programmer.ole)
  • Re: JAX-WS: Wie Exceptions behandeln?
    ... SoapFault gemacht aber die Exception auch von "Java" ins Logfile ... Der Server oder der Client? ... Exceptions werden doch nur vom Server erzeugt. ...
    (de.comp.lang.java)
  • WCF communication error - whats the cause?
    ... I have a very simple client - server application using the WCF. ... Communications exception thrown whilst trying to write to remote service. ...
    (microsoft.public.dotnet.framework.webservices)