[Mono-bugs] [Bug 46609][Nor] Changed - AppDomain.BaseDirectory misses trailing directoryseparator on linux

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 13 Dec 2003 04:16:20 -0500 (EST)

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 gert.driesen@pandora.be.


--- shadow/46609	2003-12-11 13:40:49.000000000 -0500
+++ shadow/46609.tmp.6471	2003-12-13 04:16:20.000000000 -0500
@@ -53,6 +53,34 @@
 ------- Additional Comments From gonzalo@ximian.com  2003-12-11 13:40 -------
 Someone provided a test case that lead me to do that.
 If something is wrong (mmm, may be for '/'...) could you provide a
 test case?
+------- Additional Comments From gert.driesen@pandora.be  2003-12-13 04:16 -------
+I looked further into the AppDomain.BaseDirectory issue, with regards 
+to the ending DriecftorySeparatorChar, and I've come to the following 
+findings :
+- .NET never alters the path you pass into the AppDomain (by setting
+AppDomainSetup.ApplicationBase), unless its a URI ofcourse ... so it
+definitely does not add a DirectorySeparatorChar to the path.  Which 
+means the current behaviour of Mono is correct.
+- when no explicit base directory is set for a newly created 
+AppDomain, the base directory of the "root" AppDomain will be used -> 
+note : I'm not 100% sure about this
+- the .NET runtime does add a DirectorySeparatorChar to the end of the
+BaseDirectory (and AppDomainSetup.ApplicationBase) for domains 
+constructed by the runtime itself.  eg. when you launch a console 
+app, winform app or web app, the appdomains for these apps will have 
+a trailing DirectorySeparatorChar.  This should be fixed in Mono.
+I attached a simple unit tests for AppDomain (tests 2 and 4 fail on 
+Mono right now), and an even simpler test app that demonstrates the 
+fact the .NET adds a DirectorySeparatorChar to the end of the 
+BaseDirectory for appdomains that are created by the runtime itself, 
+as I don't know how to test this as part of a unit test ...