oct. 01

Publicize.exe is the VS tool that is responsible for generating the accessors for Visual Studio and I came across a scenario yesterday that was causing a bug. Here is the code we used :

public interface MyGenericInterface<T>
   void MyMethod();
public class MyClass<T> : MyGenericInterface<T>
   void MyGenericInterface<T>.MyMethod()

So what's happening ? If you have any test DLL that reference this DLL, with an accessor on the DLL you will receive an error like "Method 'MyMethod' in type '...MyClass_Accessor`1' from assembly '...' does not have an implementation". This is quite funny bacause as all the types are public, there is no need for an accessor.

Is there any workaround to that problem ? Implement the interface implicitely and it will work like a charm.

For any news, about that, check this post on MS forums.



Ajouter un commentaire

  • Commentaire
  • Aperçu immédiat