[Mono-bugs] [Bug 55320][Nor] Changed - mcs search filename in AssemblyKeyFile in local directory

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 8 Mar 2004 16:09:46 -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 jaak@zd.com.pl.


--- shadow/55320	2004-03-08 15:02:00.000000000 -0500
+++ shadow/55320.tmp.16966	2004-03-08 16:09:46.000000000 -0500
@@ -1,14 +1,14 @@
 Bug#: 55320
 Product: Mono: Compilers
 Version: unspecified
+OS: unknown
 OS Details: 
 Status: NEW   
+Severity: Unknown
 Priority: Normal
 Component: C#
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: gert.driesen@pandora.be               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -43,6 +43,40 @@
 ------- Additional Comments From gert.driesen@pandora.be  2004-03-08 15:02 -------
 Created an attachment (id=6887)
 source containing AssemblyKeyFile attribute
+------- Additional Comments From jaak@zd.com.pl  2004-03-08 16:09 -------
+I was pretty sure that MS DOES use current directory for key lookup so
+I've made some tests.
+./a.cs contains
+[assembly: System.Reflection.AssemblyKeyFile("aaa.snk")]
+and ./a2.cs contains:
+[assembly: System.Reflection.AssemblyKeyFile("../aaa.snk")]
+I generated two *.snk files - one placed in the current directory, the
+other placed in "out" directory. Let's call the one in current
+directory KEY1, let's call the other one KEY2.
+With this setup I've made the following tests with .NET 1.1:
+a) Compiled "a.cs" to "a.dll" - KEY1 was used (as expected)
+b) Compiled "a.cs" to "out\a.dll" - KEY1 was used (SURPRISE!)
+c) Compiled "a2.cs" to "out\a2.dll" - KEY1 was used (as expected)
+d) After these tests I deleted KEY1 file and compiled again
+e) Compiled "a.cs" to "out\a.dll" - KEY2 was used (as expected)
+f) Compiled "a.cs" to "a.dll" - error (as expected)
+g) Compiled "a2.cs" to "out\a2.dll" - error (as expected)
+So it looks like the compiler first attempts to lookup the key in
+current directory, and when it's not found it attempts an
+output-directory-based lookup.
+Hope it helps.