Re: 'System.NullReferenceException'

From: Sunny (sunny_at_newsgroup.nospam)
Date: 02/28/05


Date: Mon, 28 Feb 2005 13:26:59 -0600

In article <9D55237B-863F-4BDA-8609-8A38583F048A@microsoft.com>,
DavidSanchez@discussions.microsoft.com says...
> An unhandled exception of type 'System.NullReferenceException' occurred in
> mscorlib.dll
>
> I get this error after acquiring an object:
> objDSRemote1 = CType(Activator.GetObject(Type.GetType
> "DataLayer.clsSettings, DataLayer"), "//TestPC/clsSettings"),
> DataLayer.clsSettings)
>
> Then I access a function in the remote object:
>
> objDSRemote1.Register(Me, System.Environment.MachineName)
>
> I get the error when I access register function.
>
> This only happens when I try to access the object for the first time.
>
> After the client app crashes I restart the client and I can access the
> remote object without any problems.
>
> I ask this question again: Do I need to have the proxy/server Create an
> instance when it launches before the clients or is there something I am not
> calling prier to access the function in the remote object?
>
>

Where the exception is thrown, at server or at client? Have you put some
logging in at the server, at least to know if the call enters the
Register function at all? And you may put some logging in the
constructor of your server object to see if it is created and when.

And please, read this:
http://www.yoda.arachsys.com/csharp/complete.html
and this:
http://www.catb.org/~esr/faqs/smart-questions.html

Sunny



Relevant Pages

  • Re: Question on SerializationException
    ... I want to Serialize a object from server to client. ... > An unhandled exception of type ... > MarshalByRefObject because it affect the server performance and loading. ...
    (microsoft.public.dotnet.framework.remoting)
  • Question on SerializationException
    ... I want to Serialize a object from server to client. ... An unhandled exception of type ... MarshalByRefObject because it affect the server performance and loading. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: System.NullReferenceException
    ... >> I get the error when I access register function. ... >> After the client app crashes I restart the client and I can access the ... >> calling prier to access the function in the remote object? ... > logging in at the server, at least to know if the call enters the ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: VERY Frustrated
    ... I built the solution and then executed the server.exe file and set my client ... Additional information: The underlying connection was closed: The remote ... > exception may have been caused by your .NET remoting component as well as ... > When the unhandled exception will be raised, VS will tell you what it is, ...
    (microsoft.public.dotnet.framework.remoting)
  • MAPI control with C# causes exception when calling Send()
    ... MSMAPI.MAPISessionClass session = new MSMAPI.MAPISessionClass; ... When my default client is Outlook Express, ... An unhandled exception of type ...
    (microsoft.public.dotnet.languages.csharp)

Loading