[Mono-list] "Error Initialising the configuration system" when creating TcpClient

mcd40 mcd40 at cam.ac.uk
Fri Jun 17 11:46:01 EDT 2011

I am trying to run a .net 4.0 application, written and compiled in VS 2010,
on a linux machine which doesn't have mono installed.  In order to do this I
have set up a linux dev machine with mono 2.10.2 installed and I'm using
mkbundle with the --static option to compile in the runtime.  

So far I've successfully run, on both my dev machine and the target machine,
some simple console apps and I'm now moving towards adding some networking
support that I require.  The network test application runs fine on both my
windows and the linux dev machine.  When I try to run on the target machine
however I get a System.Configuration.ConfigurationErrorsException thrown
when trying to create a new System.Net.Sockets.TcpClient.  I'm a bit stuck
as to what I can try to resolve this issue and any help is greatly
appreciated.  The full stack trace is provided below for reference

NetworkComms.ConnectionSetupException: Error during connection to
destination. Destination may not be listening or attemping to create a
second connection.System.TypeInitializationException: An exception was
thrown by the type initializer for System.Net.Sockets.Socket --->
System.Configuration.ConfigurationErrorsException: Error Initializing the
configuration system. --->
System.Configuration.ConfigurationErrorsException: Unrecognized
configuration section <startup>
(/home/mcd40/Debug/NetworkCommsTest.exe.config line 3)
  at System.Configuration.ConfigInfo.ThrowException (System.String text,
System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0 
  at System.Configuration.SectionGroupInfo.ReadContent (System.Xml.XmlReader
reader, System.Configuration.Configuration config, Boolean overrideAllowed,
Boolean root) [0x00000] in <filename unknown>:0 
  at System.Configuration.SectionGroupInfo.ReadRootData
(System.Xml.XmlReader reader, System.Configuration.Configuration config,
Boolean overrideAllowed) [0x00000] in <filename unknown>:0 
  at System.Configuration.Configuration.ReadConfigFile (System.Xml.XmlReader
reader, System.String fileName) [0x00000] in <filename unknown>:0 
  at System.Configuration.Configuration.Load () [0x00000] in <filename
  at System.Configuration.Configuration.Init (IConfigSystem system,
System.String configPath, System.Configuration.Configuration parent)
[0x00000] in <filename unknown>:0 
  at System.Configuration.Configuration..ctor
(System.Configuration.InternalConfigurationSystem system, System.String
locationSubPath) [0x00000] in <filename unknown>:0 
  at System.Configuration.InternalConfigurationFactory.Create (System.Type
typeConfigHost, System.Object[] hostInitConfigurationParams) [0x00000] in
<filename unknown>:0 
  at System.Configuration.ConfigurationManager.OpenExeConfigurationInternal
(ConfigurationUserLevel userLevel, System.Reflection.Assembly
calling_assembly, System.String exePath) [0x00000] in <filename unknown>:0 
  at System.Configuration.ClientConfigurationSystem.get_Configuration ()
[0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Configuration.ClientConfigurationSystem.get_Configuration ()
[0x00000] in <filename unknown>:0 
(System.String configKey) [0x00000] in <filename unknown>:0 
  at System.Configuration.ConfigurationManager.GetSection (System.String
sectionName) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.Socket.CheckProtocolSupport () [0x00000] in
<filename unknown>:0 
  at System.Net.Sockets.Socket..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Net.Sockets.TcpClient.Init (AddressFamily family) [0x00000] in
<filename unknown>:0 
  at System.Net.Sockets.TcpClient..ctor () [0x00000] in <filename unknown>:0 
  at NetworkComms.NetworkComms.CheckForTCPConnection (System.String
targetIPAddress) [0x00000] in <filename unknown>:0 
  at NetworkComms.NetworkComms.CheckForTCPConnection (System.String
targetIPAddress) [0x00000] in <filename unknown>:0 
  at NetworkComms.NetworkComms.SendRecieveObject[String] (PacketType
sendingPacketType, System.String destinationIPAddress, Boolean
receiveConfirmationRequired, PacketType expectedReturnPacketType, Int32
returnPacketTimeOutMilliSeconds, System.Object sendObject) [0x00000] in
<filename unknown>:0 
  at NetworkCommsTest.Program.Main (System.String[] args) [0x00000] in
<filename unknown>:0 

View this message in context: http://mono.1490590.n4.nabble.com/Error-Initialising-the-configuration-system-when-creating-TcpClient-tp3605730p3605730.html
Sent from the Mono - General mailing list archive at Nabble.com.

More information about the Mono-list mailing list