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 [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=79181 --- shadow/79181 2006-08-26 18:21:41.000000000 -0400 +++ shadow/79181.tmp.10614 2006-08-26 18:21:41.000000000 -0400 @@ -0,0 +1,42 @@ +Bug#: 79181 +Product: Mono: Class Libraries +Version: unspecified +OS: GNU/Linux [Other] +OS Details: Ubuntu 6.06 (dapper) +Status: NEW +Resolution: +Severity: 001 One hour +Priority: Normal +Component: CORLIB +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: Assembly.CodeBase does not return the expected result + +Description of Problem: +I'm using Mono 1.1.16.1 from the x86 Linux Installer. + +The goal is to get the program directory: + +string assemblyPath = +System.Reflection.Assembly.GetExecutingAssembly().CodeBase; +string programDir = +Path.GetDirectoryName(assemblyPath.TrimStart("file:///".ToCharArray())); + +Result on Windows (.NET 2.0) +assemblyPath = file:///C:/Projects/TestApp/bin/Debug/TestApp.exe +programDir = C:\\Projects\\TestApp\\bin\\Debug + +Result on Mono/Linux (1.1.16.1): +assemblyPath = file:///home/username/Projects/TestApp/bin/Debug/TestApp.exe +programDir = home/username/Projects/TestApp/bin/Debug + +The expected result of Assembly.CodeBase on Linux/Mono should be: +file:////home/username/Projects/TestApp/bin/Debug/TestApp.exe + + +Maybe this is not a bug, but then you need extra code to identify the +operationsystem. And this is not a good solution. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
