Remoting crashes IIS

W

William

Hi

I'm busy developing a .NET remoting application. Tcp remoting with a binary formatter is used. The user can specify on the client configuration whether to connect to the hosted Singleton or SingleCall objects. The application consists out of the following:

- Shared assembly

This contains serializable classes that are shared between the server and client applications. This also includes interfaces for the server classes.

- Server assembly

This assembly implements the various interfaces from the Shared assembly and communicates directly with the database. Assembly is hosted in a Windows service.

- General assembly

This assembly contains proxy classes and serves as a link between the client applications and the server assembly. When an application starts, it creates an instance of the General class which in turn creates proxy classes to the server classes.

Each proxy class, on creation, calls the RegisterWellKnownServiceType for the respective server class. This keeps everything in one place. This assembly also provides the Login functionality for all applications.

- Client Applications

The client applications have no reference to the Server assembly. When the client application starts, an instance of the General class from the General assembly is created, which automatically prompts with the login screen and configure the remoting classes.

The client application can then just call a function on the correct proxy.

E.g. The Employee Management Module can call the My.MainObj.EmployeeProxy.Save(EmployeeObj). (MainObj is the General class and EmployeeObj is a serializable class from the Shared assembly)

Up to this point... Everything works great. The problem comes in with the web application which also uses the General assembly's proxy classes.

When I use the web for the first time, it works fine. If I however close Internet Explorer and try to access the site again (or try to access the site from another computer), I get the following error:


Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 8: Public Sub New(ByVal Parent As General.GeneralClient)Line 9: _General = ParentLine 10: RemotingConfiguration.RegisterWellKnownServiceType( _Line 11: GetType(ServerInterfaces.IEmployeeManagement), _Line 12: String.Format(_General.ServerUrl, My.Settings.IEmployeeManagement), _Line 13: My.Settings.RemoteAccessMode)

In the code above, ServerInterfaces.IEmployeeManagement is the interface from the Shared assembly. _General.ServerUrl is the full url to the object which is initialized when retrieving the settings for the client application (e.g. tcp://10.0.0.10:1921/{0}.rem). My.Settings.IEmployeeManagement is the name of the class being hosted (for Singleton, it will be "EmployeeManagement". SingleCall will be "EmployeeManagement_SC"). My.Settings.RemoteAccessMode will be either Singleton or SingleCall.

After this error, the IIS process or something actuallly crashes. If I refresh then, it works again.


Any ideas on how to solve this?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top