mail-archives/mono-bugs/2010-October/104757.html

192 строки
4.7 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-bugs] [Bug 645572] New: Using dynamic from different assembly doesn't work
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20645572%5D%20New%3A%20Using%20dynamic%20from%20different%20assembly%0A%09doesn%27t%20work&In-Reply-To=">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="104755.html">
<LINK REL="Next" HREF="104782.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-bugs] [Bug 645572] New: Using dynamic from different assembly doesn't work</H1>
<B>bugzilla_noreply at novell.com</B>
<A HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20645572%5D%20New%3A%20Using%20dynamic%20from%20different%20assembly%0A%09doesn%27t%20work&In-Reply-To="
TITLE="[Mono-bugs] [Bug 645572] New: Using dynamic from different assembly doesn't work">bugzilla_noreply at novell.com
</A><BR>
<I>Mon Oct 11 17:33:41 EDT 2010</I>
<P><UL>
<LI>Previous message: <A HREF="104755.html">[Mono-bugs] [Bug 635912] Subsequent calls to web service return null reference
</A></li>
<LI>Next message: <A HREF="104782.html">[Mono-bugs] [Bug 645572] Using dynamic from different assembly doesn't work
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#104757">[ date ]</a>
<a href="thread.html#104757">[ thread ]</a>
<a href="subject.html#104757">[ subject ]</a>
<a href="author.html#104757">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>
<A HREF="https://bugzilla.novell.com/show_bug.cgi?id=645572">https://bugzilla.novell.com/show_bug.cgi?id=645572</A>
<A HREF="https://bugzilla.novell.com/show_bug.cgi?id=645572#c0">https://bugzilla.novell.com/show_bug.cgi?id=645572#c0</A>
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: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at lists.ximian.com</A>
ReportedBy: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono at e-tobi.net</A>
QAContact: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at lists.ximian.com</A>
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 = &quot;test&quot;;
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: <A HREF="https://bugzilla.novell.com/userprefs.cgi?tab=email">https://bugzilla.novell.com/userprefs.cgi?tab=email</A>
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="104755.html">[Mono-bugs] [Bug 635912] Subsequent calls to web service return null reference
</A></li>
<LI>Next message: <A HREF="104782.html">[Mono-bugs] [Bug 645572] Using dynamic from different assembly doesn't work
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#104757">[ date ]</a>
<a href="thread.html#104757">[ thread ]</a>
<a href="subject.html#104757">[ subject ]</a>
<a href="author.html#104757">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-bugs">More information about the mono-bugs
mailing list</a><br>
</body></html>