Questions about recompiling a registered dotNet COM library

M

mnvikefan

I have written a library in dotNet and registered it using the REGASM
tool with the TLB option and then used GACUTIL to enter it into global,
what do I need to when I need to recompile this library? Do I need to
first remove it from the global assembly and then unregister it? After
compiling will I need to re-register it and run GACUTIL again?

Thanks.
 
M

Mattias Sjögren

Do I need to first remove it from the global assembly and then unregister it?

You don't have to remove the old version from the GAC unless you want
to. As long as the new one has a different version they can coexist in
the GAC.

After compiling will I need to re-register it and run GACUTIL again?

If you change the version number, yes. If you keep the version number
and exported COM interfaces unchenged, you don't have to register
again.


Mattias
 
M

mnvikefan

When you said "If you change the version number...", did that refer to
the whole version string containing the Major Version, Minor Version,
Build Number and Revision or just a certain part of the version string?

In my AssemblyInfo.cs file I have the AssemblyVersion attribute set to
"1.0.*" which will be updated each time I build with a new build number
and revision. would this require me to run GACUTIL /i again? I first
don't remove the entry using GACUTIL /u, will I end up with two entries
of the library in the GAC, but only one version of the DLL existing on
the system.
 
M

Mattias Sjögren

When you said "If you change the version number...", did that refer to
the whole version string containing the Major Version, Minor Version,
Build Number and Revision or just a certain part of the version string?

Any change to the version number.

In my AssemblyInfo.cs file I have the AssemblyVersion attribute set to
"1.0.*" which will be updated each time I build with a new build number
and revision. would this require me to run GACUTIL /i again?

Yes, and that can be a major pain. Auto-incrementing version numbers
and using the GAC don't go well together IMO. I would set a fixed
version or skip the GAC for now.
I first
don't remove the entry using GACUTIL /u, will I end up with two entries
of the library in the GAC, but only one version of the DLL existing on
the system.

Both will still exist if installed in the GAC. But if the client is
COM based, you're probably only interested in a single version (the
latest) anyway.


Mattias
 

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