The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

venki (3) [Avatar] Offline
When I compile the code for listing 5.4, helloservice.cs using the helloservice.exe.http.singleton.config file and then run helloservice I get the following error

Unhandled Exception: System.Runtime.Remoting.RemotingException: Remoting configu
ration failed with the exception System.Reflection.TargetInvocationException: Ex
ception has been thrown by the target of an invocation. ---> System.TypeLoadExce
ption: Could not load type System.Runtime.Remoting.Channels.Http.HttpServerTrans
portSink from assembly System.Runtime.Remoting, Version=1.0.5000.0, Culture=neut
ral, PublicKeyToken=b77a5c561934e089 because the method ProcessMessage could not
be loaded.
at System.Runtime.Remoting.Channels.Http.HttpServerChannel..ctor(IDictionary
properties, IServerChannelSinkProvider sinkProvider)
at System.Runtime.Remoting.Channels.Http.HttpChannel..ctor(IDictionary proper
ties, IClientChannelSinkProvider clientSinkProvider, IServerChannelSinkProvider
at System.Reflection.RuntimeConstructorInfo.InternalInvoke(BindingFlags invok
eAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinder
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, B
inder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder bin
der, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binde
r binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Runtime.Remoting.RemotingConfigHandler.CreateChannelFromConfigEntry
(ChannelEntry entry)
at System.Runtime.Remoting.RemotingConfigHandler.ConfigureChannels(RemotingXm
lConfigFileData configData)
at System.Runtime.Remoting.RemotingConfigHandler.ConfigureRemoting(RemotingXm
lConfigFileData configData).
at System.Runtime.Remoting.RemotingConfigHandler.ConfigureRemoting(RemotingXm
lConfigFileData configData)
at System.Runtime.Remoting.RemotingConfiguration.Configure(String filename)
at HelloService.Main(String[] args)

Any ideas how I can get around this?

Absinthe (5) [Avatar] Offline
Re: 5.3, 5.4 helloservice.cs Error
I am working through this book at present. I have gotten past that exercise and it worked for me without that exception. I would check closer for typo's. However, if you would like to post your file information I can compare it to what I have and try to help.

They do answer questions here, but not always as fast as my impatience dictates. smilie
venki (3) [Avatar] Offline
Re: 5.3, 5.4 helloservice.cs Error
I was able to solve this issue by reinstalling the .Net framework. However when I run helloclientca3 (I downloaded the examples from this site and have not changed the code) I get the following error:

starting HTTP Hello client...

Unhandled Exception: System.Security.SecurityException: Type System.Runtime.Remo
ting.Lifetime.ISponsor and the types derived from it (such as HelloSponsor) are
not permitted to be deserialized at this security level.

Server stack trace:
at System.Runtime.Serialization.FormatterServices.CheckTypeSecurity(Type t, T
ypeFilterLevel securityLevel)
at System.Runtime.Serialization.Formatters.Soap.ObjectReader.CheckSecurity(Pa
rseRecord pr)
at System.Runtime.Serialization.Formatters.Soap.ObjectReader.ParseObject(Pars
eRecord pr)
at System.Runtime.Serialization.Formatters.Soap.ObjectReader.Parse(ParseRecor
d pr)
at System.Runtime.Serialization.Formatters.Soap.SoapHandler.StartChildren()
at System.Runtime.Serialization.Formatters.Soap.SoapParser.ParseXml()
at System.Runtime.Serialization.Formatters.Soap.SoapParser.Run()
at System.Runtime.Serialization.Formatters.Soap.ObjectReader.Deserialize(Head
erHandler handler, ISerParser serParser)
at System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Deserialize(Str
eam serializationStream, HeaderHandler handler)
at System.Runtime.Remoting.Channels.CoreChannel.DeserializeSoapRequestMessage
(Stream inputStream, Header[] h, Boolean bStrictBinding, TypeFilterLevel securit
at System.Runtime.Remoting.Channels.SoapServerFormatterSink.ProcessMessage(IS
erverChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestH
eaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& response
Headers, Stream& responseStream)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req
Msg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa
ta, Int32 type)
at System.Runtime.Remoting.Lifetime.ILease.Register(ISponsor obj)
at HelloClient.Main(String[] args)

Below is the content of the service window

CsmilieotNetgrimes_src_examplesDotNetExamplescha_5>helloservice helloservice.exe
configuring remoting...
waiting for remote calls...
hit ENTER to exit...
HelloObj activated...

Any ideas how I could fix this?
venki (3) [Avatar] Offline
Re: 5.3, 5.4 helloservice.cs Error
Should have checked other postings in this forum before I posted this message. There is a solution on the site.
Absinthe (5) [Avatar] Offline
Re: 5.3, 5.4 helloservice.cs Error
Glad you got an answer! Hopefully, someone will answer my issue before you get to it smilie
pnyemaf (1) [Avatar] Offline
Re: 5.3, 5.4 helloservice.cs Error
I am experiencing the Security exception also but there is no longer any What was the solution to the problem?

Thanks in advance.