[Mono-bugs] [Bug 80547][Wis] New - Crash trying to load config file in a non-root appdomain

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Jan 18 11:48:33 EST 2007

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by azraill at gmail.com.


--- shadow/80547	2007-01-18 11:48:33.000000000 -0500
+++ shadow/80547.tmp.27389	2007-01-18 11:48:33.000000000 -0500
@@ -0,0 +1,107 @@
+Bug#: 80547
+Product: Mono: Class Libraries
+Version: 1.2
+OS: GNU/Linux [Other]
+OS Details: Debian Sarge
+Status: NEW   
+Priority: Wishlist
+Component: System
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: azraill at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: Crash trying to load config file in a non-root appdomain
+When trying to download data from the web using a System.Net.WebClient 
+inside a non-root appdomain my application crashs.
+I wrote a small app to test the error:
+Public Class clsParent
+    Inherits MarshalByRefObject
+    Public Shared Sub main()
+        Dim domainsetup As New AppDomainSetup
+        domainsetup.ShadowCopyFiles = "true"
+        Dim plugindomain As AppDomain = AppDomain.CreateDomain("BugTest", 
+Nothing, domainsetup)
+        Dim assldr As clsClient = 
+ GetType(clsClient).FullName), clsClient)
+        Console.Read()
+    End Sub
+End Class
+Public Class clsClient
+    Inherits MarshalByRefObject
+    Public Function download() As Byte()
+        Dim W As New Net.WebClient
+        Return W.DownloadData("http://www.google.com")
+    End Function
+End Class
+When ran under Windows (XP, SP2) it works pretty well.
+When i try this app under Debian Sarge though it will crash returning this 
+error description:
+Unhandled Exception: System.TypeInitializationException: An exception was 
+thrown by the type initializer for System.Net.WebRequest
+Server stack trace:
+  at <0x00000> <unknown method>
+  at System.Net.WebClient.SetupRequest (System.Uri uri) [0x00000] in /tmp/
+  at System.Net.WebClient.SetupRequest (System.Uri uri, System.String 
+method) [0x00000] in /tmp/scratch/BUILD/mono-
+  at System.Net.WebClient.DownloadDataCore (System.Uri address) [0x00000] 
+in /tmp/scratch/BUILD/mono-
+  at System.Net.WebClient.DownloadData (System.Uri address) [0x00006] in /
+  at System.Net.WebClient.DownloadData (System.String address) [0x00000] 
+in /tmp/scratch/BUILD/mono-
+  at (wrapper remoting-invoke-with-check) 
+System.Net.WebClient:DownloadData (string)
+  at Bugtest.clsClient.download () [0x00000]
+  at (wrapper remoting-invoke-with-check) Bugtest.clsClient:download ()
+  at (wrapper xdomain-dispatch) Bugtest.clsClient:download 
+Exception rethrown at [0]:
+ ---> System.ArgumentException: exePath must be specified when not running 
+inside a stand alone exe.
+  at 
+(ConfigurationUserLevel userLevel, System.Reflection.Assembly 
+calling_assembly, System.String exePath) [0x00128] in /tmp/scratch/BUILD/
+  at 
+ (System.String configKey) [0x00006] in /tmp/scratch/BUILD/mono-
+  at System.Configuration.ConfigurationManager.GetSection (System.String 
+sectionName) [0x00000] in /tmp/scratch/BUILD/mono-
+  at System.Net.WebRequest..cctor () [0x00014] in /tmp/scratch/BUILD/mono-
+ --- End of inner 
+exception stack trace ---
+  at (wrapper xdomain-invoke) Bugtest.clsClient:download ()
+  at (wrapper remoting-invoke-with-check) Bugtest.clsClient:download ()
+  at Bugtest.clsParent.main () [0x00000]

More information about the mono-bugs mailing list