4

I have a .NET library visible in COM, and it's called from a vb6 application.

If I add some methods and release a new version (but don't erase or change signatures of existing methods), I would like being able to just install it in the production machine, and have it working. However, it seems that such approach doesn't work; I need to reompile the vb6 application.

Is there any way to achieve this?

linuxbuild
  • 15,843
  • 6
  • 60
  • 87
raven
  • 2,574
  • 2
  • 27
  • 49

1 Answers1

8

You can explicitly use the Guid attribute on your COM interfaces and classes and the DispId attribute on your methods, fields and properties:

[Guid("0E213759-1679-4CD1-8322-566CF76928EF")]
public class SampleClass
{
    [DispId(8)]
    public void MyMethod() {}
}
Dirk Vollmar
  • 172,527
  • 53
  • 255
  • 316
  • Is this all I need? I have the Guid but not the DisId's. Will try this ASAP, thank you! – raven Sep 09 '10 at 08:53
  • Sorry, Jammer, didn't see your comment until now. For future references, it worked like a charm. – raven Aug 14 '14 at 15:53