[Mono-bugs] [Bug 81040][Wis] New - Path with spaces causes Assembly.Load to fail
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Mon Mar 5 13:33:10 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 naasking at gmail.com.
http://bugzilla.ximian.com/show_bug.cgi?id=81040
--- shadow/81040 2007-03-05 13:33:10.000000000 -0500
+++ shadow/81040.tmp.28707 2007-03-05 13:33:10.000000000 -0500
@@ -0,0 +1,89 @@
+Bug#: 81040
+Product: Mono: Class Libraries
+Version: 1.2
+OS:
+OS Details: Windows XP
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: System
+AssignedTo: mono-bugs at ximian.com
+ReportedBy: naasking at gmail.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Path with spaces causes Assembly.Load to fail
+
+Description of Problem:
+
+
+Steps to reproduce the problem:
+1. Place a dll in a path that contains a space in the directory name
+2. Create the following test case in file "Main.cs":
+
+using System;
+using System.IO;
+using System.Reflection;
+
+namespace TestLoad
+{
+ class MainClass
+ {
+ public static void Main(string[] args)
+ {
+ string file = @"C:\Documents and Settings\Sandro\Desktop\joe-e.dll";
+ AssemblyName an = AssemblyName.GetAssemblyName(file);
+ Assembly a = Assembly.Load(an); //throws a FileNotFoundException with
+Mono 1.2.3
+ Console.WriteLine(a == null ? "no assembly found" : "found: " + a.CodeBase);
+ Console.Read();
+ }
+ }
+}
+
+2. Compile: mcs Main.cs
+3. Run: mono Main.exe
+
+Actual Results:
+
+C:\Documents and Settings\Sandro\My Documents\SharpDevelop
+Projects\TestLoad>mono --debug Main.exe
+
+Unhandled Exception: System.IO.FileNotFoundException: File or assembly name
+joe-e, Version=0.0.0.0, Culture=neutral, or one of its dependencies, was
+not found.
+File name: "joe-e, Version=0.0.0.0, Culture=neutral"
+ at <0x00000> <unknown method>
+ at (wrapper managed-to-native) System.AppDomain:LoadAssembly
+(string,System.Security.Policy.Evidence,bool)
+ at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef,
+System.Security.Policy.Evidence assemblySecurity) [0x0005a] in
+C:\cygwin\tmp\scratch\mono-1.2.3.1\mcs\class\corlib\System\AppDomain.cs:506
+ at (wrapper remoting-invoke-with-check) System.AppDomain:Load
+(System.Reflection.AssemblyName,System.Security.Policy.Evidence)
+ at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef)
+[0x00000] in
+C:\cygwin\tmp\scratch\mono-1.2.3.1\mcs\class\corlib\System\AppDomain.cs:491
+ at (wrapper remoting-invoke-with-check) System.AppDomain:Load
+(System.Reflection.AssemblyName)
+ at System.Reflection.Assembly.Load (System.Reflection.AssemblyName
+assemblyRef) [0x00000] in
+C:\cygwin\tmp\scratch\mono-1.2.3.1\mcs\class\corlib\System.Reflection\Assembly.cs:487
+ at TestLoad.MainClass.Main (System.String[] args) [0x0000d] in
+C:\Documents and Settings\Sandro\My Documents\SharpDevelop
+Projects\TestLoad\Main.cs:21
+
+C:\Documents and Settings\Sandro\My Documents\SharpDevelop Projects\TestLoad>
+
+Expected Results:
+
+C:\Documents and Settings\Sandro\My Documents\SharpDevelop
+Projects\TestLoad>mono --debug Main.exe
+found: file:///C:/Documents and Settings/Sandro/Desktop/joe-e.dll
+
+
+How often does this happen?
+
+Every time.
More information about the mono-bugs
mailing list