[Mono-bugs] [Bug 645572] New: Using dynamic from different assembly doesn't work

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Oct 11 17:33:41 EDT 2010


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

https://bugzilla.novell.com/show_bug.cgi?id=645572#c0


           Summary: Using dynamic from different assembly doesn't work
    Classification: Mono
           Product: Mono: Compilers
           Version: SVN
          Platform: x86-64
        OS/Version: Linux
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: mono at e-tobi.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Say we have an assembly test1, with a single class:

[test1.cs]

using System;

namespace DynamicTest
{
    public class Foo
    {
        public dynamic DynamicProperty { get; set; }
    }
}


Now create an executable that references and uses this assembly:

[test2.cs]

using System;

namespace DynamicTest
{
    public class Bar
    {
        public static void Main()
        {
            var foo = new Foo();
            foo.DynamicProperty = "test";
            Console.WriteLine(foo.DynamicProperty.ToUpper());
        }
    }
}

Compiling test2.cs will fail:

$ dmcs test2.cs -r:test1
test2.cs(11,51): error CS1061: Type `object' does not contain a definition for
`ToUpper' and no extension method `ToUpper' of type `object' could be found
(are you missing a using directive or an assembly reference?)
Compilation failed: 1 error(s), 0 warnings

But compiling everything into one executable/assembly works just fine:

$ dmcs test2.cs test1.cs
$ mono test2.exe
TEST

(Tested with ee2edbad34)

-- 
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