Cannot get remoting to work in IIS host

I want to use IIS to host some .NET remoting.

I have a class library with one class in it which inherits marshalbyrefobject.
I created a web config file as follows:

<system.runtime.remoting>
<application>
<service>
<wellknown mode="Singleton" type="RemotingServer.TestClass, RemotingServer" objecturi="TestClass.rem"/>
</service>
</application>
</system.runtime.remoting>

I created a virtual directory in IIS (RemotingTestHost) and copied the web config in there and the assembly into the /bin folder.

I then tried to connect using Internet Explorer.http://localhost/RemotingTestHost/TestClass.rem?wsdl

I get an http 500 error and nothing else. Once i got a cannot find service error.

I then created a windows client with a reference to the RemotingServer (just
for the metadata).
I created an app config file for the client too as follows:

<system.runtime.remoting>
<application>
<client>
<wellknown
type="RemotingServer.TestClass, RemotingServer"
url="http://localhost/RemotingTestHost/TestClass.rem"
/>
</client>
</application>
</system.runtime.remoting>

I call RemotingConfiguration.Configure but when i try to instantiate the
class i get an error saying it cannot find the service.

I know this is supposed to work, and i have had similar ones work before. so what am i missing?

[1692 byte] By [MarkShehan] at [2008-2-28]
# 1

Have you created a "Web Application" for the vroot?

If I were you, I would just use one of the samples that we ship in the .Net SDK.

douglasp at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 2
Hi,

I think you should add in your configuration files a channel entry, just like this:

Web.config:

<channels>
<channel ref="http">
</channels>

Client.exe.config:

<channels>
<channel ref="http" port="0">
</channels>

If your server does not register itself on an HTTP channel, the client won't be able to find it. Moreover, do not specify port in the Web.config file, because your server will inherit your IIS configuration. Use the "0" port on client-side to automatically determine which port should be used.
These <channels> tags should be placed both inside the <application> Tags of your config files.

Hope this will help

RomainLarmet at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...

.NET Development

Site Classified