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: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
          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.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to