Remoting issue with: C:\Windows Workflow Foundation\Labs\Lab01\Completed\Exercise 3

I’m working with the WR labs and am having a real problem with one of them. I think it’s a remoting issue and the lab is :

C:\Windows Workflow Foundation\Labs\Lab01\Completed\Exercise 3

I have completely rebuilt all projects involved and when I run the exe I get this error:

In debug it breaks on:

RemotingConfiguration.Configure("ExpenseHost.exe.config");

In this class:

namespace ExpenseHost

{

class Program

{

static void Main(string[] args)

{

RemotingConfiguration.Configure("ExpenseHost.exe.config");

//TcpChannel chan = new TcpChannel(8085);

//ChannelServices.RegisterChannel(chan);

//RemotingConfiguration.RegisterWellKnownServiceType(typeof(ExpenseLocalServices.ExpenseRemoteService),

// "ExpenseRemoteService", WellKnownObjectMode.Singleton);

System.Console.WriteLine("Hit <enter> to exit...");

System.Console.ReadLine();

}

}

}

The msg is:

Remoting configuration failed with the exception 'System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted

at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)

at System.Net.Sockets.Socket.Bind(EndPoint localEP)

at System.Net.Sockets.TcpListener.Start(Int32 backlog)

at System.Net.Sockets.TcpListener.Start()

at System.Runtime.Remoting.Channels.ExclusiveTcpListener.Start(Boolean exclusiveAddressUse)

at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.StartListening(Object data)

at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.SetupChannel()

at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor(IDictionary properties, IServerChannelSinkProvider sinkProvider, IAuthorizeRemotingConnection authorizeCallback)

at System.Runtime.Remoting.Channels.Tcp.TcpChannel..ctor(IDictionary properties, IClientChannelSinkProvider clientSinkProvider, IServerChannelSinkProvider serverSinkProvider)

--- End of inner exception stack trace ---

at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct& signature, IntPtr declaringType)

at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, SignatureStruct signature, RuntimeTypeHandle declaringType)

at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)

at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)

at System.Runtime.Remoting.RemotingConfigHandler.CreateChannelFromConfigEntry(ChannelEntry entry)

at System.Runtime.Remoting.RemotingConfigHandler.ConfigureChannels(RemotingXmlConfigFileData configData, Boolean ensureSecurity)

at System.Runtime.Remoting.RemotingConfigHandler.ConfigureRemoting(RemotingXmlConfigFileData configData, Boolean ensureSecurity)'.

And the stack trace is:

at System.Runtime.Remoting.RemotingConfigHandler.ConfigureRemoting(RemotingXmlConfigFileData configData, Boolean ensureSecurity)

at System.Runtime.Remoting.RemotingConfigHandler.DoConfiguration(String filename, Boolean ensureSecurity)

at System.Runtime.Remoting.RemotingConfiguration.Configure(String filename, Boolean ensureSecurity)

at System.Runtime.Remoting.RemotingConfiguration.Configure(String filename)

at ExpenseHost.Program.Main(String[] args) in C:\Windows Workflow Foundation\Labs\Lab01\Resources\ExpenseReporting\ExpenseHost\Program.cs:line 34

the config file its referenceing has this in it:

< xml version="1.0" encoding="utf-8" >

<configuration>

<system.runtime.remoting>

<application>

<service>

<wellknown mode="Singleton"

type="ExpenseLocalServices.ExpenseRemoteService, ExpenseLocalServices"

objectUri="ExpenseRemoteService" />

</service>

<channels>

<channel ref="tcp" port="8085" />

</channels>

</application>

</system.runtime.remoting>

</configuration>

I don’t know anything about remoting yet. Could it be that I need to specify a different port Or could it be a windows security setting This is a clean machine will all software newly installed and I haven’t done anything to the security settings that I’m aware other than when I first ran this project a windows firewall msg popped up asking me to allow or block this app. Of course I selected allow.

Any idea what’s going on here and how I can resolve this

Thanks.



Answer this question

Remoting issue with: C:\Windows Workflow Foundation\Labs\Lab01\Completed\Exercise 3

  • Tom0674

    I guess that's possible, but I was running it straight from the lab which should have been tested by the MS team.
  • James Manning

    I think this message indicates that you have another instance of the ExpenseHost already running on your machine.

    Only one usage of each socket address (protocol/network address/port) is normally permitted

    Regards,
    Paul



  • Remoting issue with: C:\Windows Workflow Foundation\Labs\Lab01\Completed\Exercise 3