.NET 1.1 and 2.0 interface binary compatibility

H

hatch

Hi,

i have an issue with .NET 2.0 compiler, that generates different
interface assemblies than .NET 1.1 compiler. And this causes
applications (compiled against 1.1 interfaces) to throw
System.MissingMethodException. Recompiling application (no changes
made) with 2.0 interfaces solves the problem. - But this still breaks
binary compatibility, which should be maintained considering
interfaces themselves were not changed.


Ildasm output of interfaces compiled with .NET 1.1

..property instance valuetype
Marg.Planet.Interfaces.Portlet.WindowState
WindowState()
{
.get instance valuetype Marg.Planet.Interfaces.Portlet.WindowState
Marg.Planet.Interfaces.Portlet.IPortletRequest::get_WindowState()
} // end of property IPortletRequest::WindowState


Ildasm output of interfaces compiled with .NET 2.0

..method public hidebysig newslot specialname abstract virtual
instance valuetype
[Marg.Planet.Interfaces]Marg.Planet.Interfaces.Portlet.WindowState
get_WindowState() cil managed
{
} // end of method IPortletRequest::get_WindowState


The difference is in get_WindowState() method's signature...

Note that Marg.Planet.Interfaces.Portlet.WindowState
is enum in Marg.Planet.Interfaces.dll assembly
public enum WindowState { ... }

And is getter (with same name)
in Marg.Planet.Interfaces.Portlet.dll assembly
WindowState WindowState { get; }


I realize this was a bad coding practice to begin with, but is there
any solution to make it binary compatible?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top