Hi Andredem,
Yes, this is really a strange issue. Based on my research, I find that the
C# compiled generated IL is almost the same with VS.net2003 and VS2005:
VS.net2003:
.method private hidebysig static void Main(string[] args) cil managed
{
.entrypoint
.maxstack 1
.locals init (
[0] InterfaceMapTes t.MyControl obj,
[1] InterfaceMapTes t.IControl iControl)
L_0000: newobj instance void InterfaceMapTes t.MyControl::.c tor()
L_0005: stloc.0
L_0006: ldloc.0
L_0007: callvirt instance void InterfaceMapTes t.Control::Pain t()
L_000c: ldloc.0
L_000d: stloc.1
L_000e: ldloc.1
L_000f: callvirt instance void InterfaceMapTes t.IControl::Pai nt()
L_0014: ret
}
VS2005
.method private hidebysig static void Main(string[] args) cil managed
{
.entrypoint
.maxstack 1
.locals init (
[0] InterfaceMapTes t.MyControl obj,
[1] InterfaceMapTes t.IControl iControl)
L_0000: nop
L_0001: newobj instance void InterfaceMapTes t.MyControl::.c tor()
L_0006: stloc.0
L_0007: ldloc.0
L_0008: callvirt instance void InterfaceMapTes t.Control::Pain t()
L_000d: nop
L_000e: ldloc.0
L_000f: stloc.1
L_0010: ldloc.1
L_0011: callvirt instance void InterfaceMapTes t.IControl::Pai nt()
L_0016: nop
L_0017: ret
}
As we can see that, .Net2.0 generated IL code emits 1 or 2 more nop
instruction, which does not interrupt the code logic. So the problem should
lie in runtime changes regarding interface reimplementatio n between 1.1 and
2.0 CLR.
I have forwarded this issue to our C# team, I will feedback any progress
here. Thanks
Best regards,
Jeffrey Tan
Microsoft Online Community Support
=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.