hi,
I need to know some of the fundamental issues here regarding the [Guid
("....")] and interface and coclass...and breaking a COM client ...
say I have this .net assembly and the following interface and class impl.
[Guid("F9168C5E-CEB2-4faa-B6BF-329BF39FA1E4")]
public interface IAllan
{
void MyMethod();
}
// Guid for the coclass Allan
[Guid("936DA01F-9ABD-4d9d-80C7-02AF85C822A8")]
public class Allan : IAllan
{
public void MyMethod()
{.......}
}
my assemblyversion attribute is left with the defaults. 1.0.*
My understanding here is that if you change the IAllan interface you break
the client, correct ?
now what if I removed the Guid on the coclass Allan here and sat a
specific version in the assemblyversion attribute.
this will cause my clients to work also(provided a new recompile of
course) and the client would again break if you changed the interface part.
now my oberservation here is if you tag that coclass with a Guid, it
doesn't matter if the assemblyversion get's bumped up each time on compile
correct ?, it will not cause the COM client to break. ???
BUT if you leave out the Guid on the CoClass and also leave the defaults
on the assemblyversion attribute you will break you COM client on each
build...so must specify a version 1.0.0.0.
which is better ?, tag the coclass and leave the version attribute to the
compiler or remove the coclass and specific a stable version number ?
are they any advantages one over the other ?
my point was to leave the auto-generation of clsid's to the CLR (on the
coclass) and then specify a Guid on the interface, which will not be
autogenerated by the CLR by default. further more would people not be able
to cocreate an instance of my coclass Allan directly ? and thereby
ignoring my interface definition ?
could someone shead some light on this ?
Cheers, @llan
===================================
This list is hosted by DevelopMentor� http://www.develop.com
Some .NET courses you may be interested in:
Essential .NET: building applications and components with C#
November 29 - December 3, in Los Angeles
http://www.develop.com/courses/edotnet
View archives and manage your subscription(s) at http://discuss.develop.com