[Mono-bugs] [Bug 466510] New: Assembly.CodeBase returns an incorrect value when using Shadow Copy

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jan 15 12:40:30 EST 2009


https://bugzilla.novell.com/show_bug.cgi?id=466510


           Summary: Assembly.CodeBase returns an incorrect value when
                    using Shadow Copy
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.2.x
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: lluis at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


In the following test case, Assembly.CodeBase returns the location of the
shadow copy assembly, instead of the original location. Notice that it returns
the correct value if setup.ShadowCopyDirectories is not set.

using System;
using System.IO;
using System.Reflection;

class App
{
    public static void Main (string[] args)
    {
        AppDomainSetup setup = new AppDomainSetup();

        setup.ShadowCopyFiles = "true";

        setup.ShadowCopyDirectories = Path.GetDirectoryName
(typeof(App).Assembly.Location);

        AppDomain runnerDomain = AppDomain.CreateDomain ("other",
AppDomain.CurrentDomain.Evidence, setup);

        runnerDomain.DoCallBack (Run);
    }

    static void Run ()
    {
        Console.WriteLine ("Domain: " + AppDomain.CurrentDomain.FriendlyName);
        Assembly asm = typeof(App).Assembly;
        Console.WriteLine ("asm.Location: " + asm.Location);
        Console.WriteLine ("asm.CodeBase: " + asm.CodeBase);
    }
}

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list