configuring .NET-Based components for registration-Free Activation

  • Thread starter Thread starter Andrew
  • Start date Start date
A

Andrew

Hi,

I was trying to make my C# component to be 'register-free activation'
component.
I followed the steps in MSDN and (after tweaking the errors in the example
code) I got to the step where I need to invoke the compiler with the
/win32res option to include the manifest file.
I see that I practically need to add all the nasty switches (add references,
etc) to the compiler to create my assembly.

Is there a better \ easier way ?

thank you
 
Andrew,

What do you mean by registration free? .NET components in general do
not need registration of any kind, they just need to be able to be found by
the runtime (which has very clear rules on where it looks).

What are you using the /win32res switch for exactly?

Are you talking about COM interop where you are exposing COM components
from your .NET components? If this is the case, then there is little you
should have to do at compile time, just make sure that your classes are
attributed and designed correctly.

For COM interop, I would recommend registering them in the GAC, since it
falls in line with how COM components are registered/deployed today (they
are in a defined location, etc, etc). Even though you have reg-free COM, my
opinion is that is only good for unmanaged code, not managed code.

Hope this helps.
 
I kind of thought it was something like this. Personally, I would just
register the component, but I can understand the desire to do so.

From an academic point of view, it kind of violates the tenants of com,
to have reg free components, because you are basically saying that the
implementation is not fixed (you could actually have a class id which has
multiple implementations) which is not a good thing.
 
Hi, thanks for your answers.
Yes, that's the page, pointed by Barry.
Yet, above pros\cons of this registration technique, is there a better way ?
I see that I need to invoke the Csharp compiler with right switches.

thanks
 
Back
Top