[Mono-list] Problem with TcpClient and AppDomains

russell.kay at realtimeworlds.com russell.kay at realtimeworlds.com
Tue Dec 5 03:29:34 EST 2006



I'm building a client server application and I've had great success
working with .NET and Mono, I've been building them side by side and
have had very few problems.


But today I've encountered a problem that works fine under MS runtime
but fails under Mono and it appears to be a semantic issue which I'm not
sure about.


I'm using AppDomain's to isolate downloaded code that needs to be run on
the clients, today I created one that uses the TcpClient class,
everything worked properly under the MS runtime but when I came to run
it on the MAC then it falls over with the call stack appended below...


Now I had an issue before where on Mono it looked like the exe search
path was not getting set directly for a new AppDomain.. sure if this is
a related issue (it looks like the calling_assembly parameter that is
getting passed in is NULL).


It looks like the DNS class is using the ConfigurationManager to look
for the current network config and this is failing because it cannot
locate the exe for this Assembly in the AppDomain.


The AppDomainSetup that I am using is using ShadowCopy and a
PrivateBinPath if this info is relevant.


Does anyone know a work around?







Unhandled Exception: System.TypeInitializationException: An exception
was thrown by the type initializer for System.Net.Dns


Server stack trace: 

  at <0x00000> <unknown method>

  at System.Net.Sockets.TcpClient.Connect (System.String hostname, Int32
port) [0x00000] 

  at System.Net.Sockets.TcpClient.Connect (System.String hostname, Int32
port) [0x00000] 

  at dWorld.Network.Client.connect (System.String _name, Int32 _port)

  at ClientBundle.Client.execute (dWorld.Utility.Parameters _params,
System.Object _param, System.Collections.Generic.List`1& _tasks,
AutoBuild.Common.eResultStatus& _status, dWorld.Utility.Parameters&
_changedParams) [0x00000] 

  at (wrapper xdomain-dispatch) AutoBuild.Common.ITask:execute


Exception rethrown at [0]: 

 ---> System.ArgumentException: exePath must be specified when not
running inside a stand alone exe.

(ConfigurationUserLevel userLevel, System.Reflection.Assembly
calling_assembly, System.String exePath) [0x00000] 

rnal.IInternalConfigSystem.GetSection (System.String configKey)

  at System.Configuration.ConfigurationManager.GetSection (System.String
sectionName) [0x00000] 

  at System.Net.Sockets.Socket.CheckProtocolSupport () [0x00000] 

  at System.Net.Dns..cctor () [0x00000] --- End of inner exception stack
trace ---


  at (wrapper xdomain-invoke) AutoBuild.Common.ITask:execute

  at AutoBuildClient.Program.Main (System.String[] _args) [0x00000]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20061205/68252e46/attachment.html 

More information about the Mono-list mailing list