Remoting calls problem!

  • Thread starter Thread starter Mats-Erik Grundh
  • Start date Start date
M

Mats-Erik Grundh

Remoting calls problem!

I have problem with remoting calls, sometimes the application "locks" about
2 minutes when i call the server before it releases the remoting call and
everything is normal again. Sometimes the application just ends without any
exception.

Problem code:

Client remoting setup:
======================

' Register the HTTP Channel
Dim channelProperties As New ListDictionary
channelProperties.Add("useDefaultCredentials", True)
channelProperties.Add("machineName",
CO.Win.Data.DataSingleton.RemotingServer)
' The machineName property must be set to the same server as the http code
download was made from
' Otherwise a 2 minute delay will occur before client starts.

Dim formatterProperties As New ListDictionary
formatterProperties.Add("includeVersions", False)

Dim providerProperties As New ListDictionary
Dim serverProvider As New BinaryServerFormatterSinkProvider
serverProvider.TypeFilterLevel =
Runtime.Serialization.Formatters.TypeFilterLevel.Full

' Create and register channel
Dim channel As New HttpChannel(channelProperties, New
BinaryClientFormatterSinkProvider(formatterProperties, providerProperties),
serverProvider)

ChannelServices.RegisterChannel(channel)

..
..
..
RemotingConfiguration.RegisterWellKnownClientType(GetType(CO.Scenario.coScen
arioAG), "http://" + CO.Win.Data.DataSingleton.RemotingServer +
"/conet/coScenarioAG.soap")
..
..
..



Client Winforms Code:
=====================
Dim arrayListOfDatasets As New ArrayList
Dim scenarioAG As New CO.Scenario.coScenarioAG
scenarioAG = New CO.Scenario.coScenarioAG
Dim index As Integer
index = arrayListOfDatasets.Add(AGData.DatasetAG.GetChanges)
scenarioAG.Save(arrayListOfDatasets)
scenarioAG = Nothing


Server remoting setup:
======================
<system.runtime.remoting>
<application>
<channels>
<channel ref="http">
<serverProviders>
<formatter ref="binary" includeVersions="false" strictBinding="false"
typeFilterLevel="Full"/>
</serverProviders>
</channel>
</channels>
 
Hello Mats,

Thanks for your post. I am checking this issue and will update you with my
information.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Dear Tian Min!

I have done som testing regarding my problems and the "locking" problem when
i make a remoting call occurs less when i added this row in my code:

System.Configuration.ConfigurationSettings.GetConfig("DNS")

I got the tips from "microsoft.public.dotnet.framework.remoting" forum. I
dont know what the this line of code doeas but it reduces number of
"locks".

The other problem, application just ends without a exception, though i use a
central exception handling. I have added debug code and found out that the
application dies/ends when it returns from a remote call.

PS:The problems are more occurent on Terminal Service Clients.

Solution Description:
==============
Server Code developed in VB VS2003.
Server Code uses COM+, serviced components.
Server code running on two servers using load balancing WLBS.
Win Forms client developed in VB VS2003.
Clients using remoting for calling server functionallity.
Clients are installed using "No Touch Deployment":
(C:\WINNT\Microsoft.NET\Framework\v1.1.4322\IEExec.exe
http://ozzy/conet/client/bin/CO.Win.EXE)
Clients using Windows 2000 WS, Windows XP Pro and Terminal server 2000.


Thanks in advance!
 
Hello Mats,

Based on my research, there is a known issue that accessing the
system.configuration may has a deadlock which causes it to wait for two
minutes before it comes back. To workaround the problem, please add the
following line of code before the program begans.



System.Configuration.ConfigurationSettings.GetConfig("system.diagnostics")

Please check it on your side. I am standing by for your result.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Hello Tian Min!

Whats the purpose of that line of code?

I run my application as "no touch deployment ", the shortcut looks like
this:

C:\WINNT\Microsoft.NET\Framework\v1.1.4322\IEExec.exe
http://ozzy/conet/client/bin/CO.Win.EXE

And sometimes i use application parameters:

C:\WINNT\Microsoft.NET\Framework\v1.1.4322\IEExec.exe
http://ozzy/conet/client/bin/co.win.exe?servername=ozzy

I don't think the line of code,
System.Configuration.ConfigurationSettings.GetConfig("system.diagnostics")
, works when i use properties. I seems that ist lookeing for at config file
that has the name co.win.exe?servername=ozzy.config

Thanks in advance!
 
Hi Mats-Erik,

I thought I could explain a bit more about what Tian Min described. If the
issue you are seeing is related to a 2 minute delay as you indicated, then
the problem may be caused by a known issue with no-touch deployment. We
see this sometimes with Remoting calls when the client is hosted in IE, but
the issue has nothing to do with Remoting.

The problem applies to href exes that are downloaded from a web server.
Example scenarios where we have seen this problem include opening a Sql
connection or making a Remoting call from the no-touch-deployed EXE. Both
of these cause the CLR to load PerfMon counters. If there is already an
outgoing socket call (such as for Remoting or connecting to a SQL Server),
loading of these counters will be blocked because the CLR tries to contact
the server from which the EXE was downloaded. By forcing the config system
to be initialized earlier (before making the Remoting call), this blocking
issue is prevented. That's why Tian Min suggested that line of code as a
work around.

Unfortunately, if you still experience this problem even with that line of
code in place, then we will need to debug the problem further because it
would seem to be a different issue. If you are familiar with using the
Debugging Tools for Windows, then you can attach the debugger and you
should be able to identify the calls on the stack at the time of the delay.
If you are not familiar with using the debuggers, then we would need you
to create a hang dump during the delay behaviour and open a troubleshooting
case with Microsoft PSS for dump analysis.


On the other issue you mentioned, namely that the application silently
disappears, that sounds to me like an unhandled exception may be causing
the hosting process to crash. It's possible that an exception may be
happening at a lower layer than your code and we would need to attach the
debuggers and troubleshoot for a crash to determine the cause.

I hope that answers your questions.

Rob Maushardt
Microsoft Distributed Services


This posting is provided "AS IS" with no warranties, and confers no rights.
 
Thank you for Your answer!

That line of code has reduced "locks/wait" to a minimun but its impossible
to send parameters to the application at startup like:

http://ozzy/conet/client/bin/co.win.exe?servername=ozzy

The other problem that made my application end with no exception was related
to a datagrid.

Thanks again for Your excellent answer!

/Mats-Erik Grundh
 
Back
Top