Com+ components

T

tshad

I have been creating my COM+ companents like so:

c:\GeoCOM\regsvcs /appname:GeoCOM c:\GeoCOM\Geo.GeoClientCOM.dll

I was doing it many times with no problem and only one component showed up
in the Component Services window.

About 3 weeks later I made some changes to it, and now there are 3 of them
there after I did a comple of the above commands. I went into the
Component Services and deleted them. Now I can make many changes and
reinstall over and over and only one shows up.

What causes the multiple ones to show up?

Is there a way to delete all 3 of them (or more) using a variant of the
above command?

I have to give this to a client and I want them to delete them before
installing them and I don't want to have them go to the Component Services
window to do it. On Vista it is a real pain to do it as you have set up a
new snap-in to do it. Not sure why MS decided to change that. Just MS
being MS, I suppose.

Thanks,

Tom
 
A

Alberto Poblacion

tshad said:
[...]
About 3 weeks later I made some changes to it, and now there are 3 of them
there after I did a comple of the above commands. I went into the
Component Services and deleted them. Now I can make many changes and
reinstall over and over and only one shows up.

What causes the multiple ones to show up?

This can happen if you forget to add the "Application ID" attribute to
your source code:
[assembly: ApplicationID("your-GUID-here")]

If you don't explicitly assign an ID to the application, one will be
automatically generated. Every time it changes, the application will be
registered as a new entry in Component Services.
 
T

tshad

So if I have the following:
*******************************************************************
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.EnterpriseServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the
information
// associated with an assembly.
[assembly: AssemblyTitle("Geo.GeoClientCOM")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Geo.GeoClientCOM")]
[assembly: AssemblyCopyright("Copyright © 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(true)]

// The following GUID is for the ID of the typelib if this project is
exposed to COM
[assembly: Guid("c1c78e6a-2c41-469f-9976-835770b4be5f")]

// Version information for an assembly consists of the following four
values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision
Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

[assembly: ApplicationName("GeoCOM")]
[assembly: ApplicationActivation(ActivationOption.Library)]
*******************************************************************

Would I just put the line:

[assembly: ApplicationID("c1c78e6a-2c41-469f-9976-835770b4be5f")]

after

[assembly: Guid("c1c78e6a-2c41-469f-9976-835770b4be5f")]

Is this Guid I should be using?

Also is there a way to use "regsvcs" to delete all 3 of them (or more) of
the existing objects?

Thanks,

Tom



Alberto Poblacion said:
tshad said:
[...]
About 3 weeks later I made some changes to it, and now there are 3 of
them there after I did a comple of the above commands. I went into the
Component Services and deleted them. Now I can make many changes and
reinstall over and over and only one shows up.

What causes the multiple ones to show up?

This can happen if you forget to add the "Application ID" attribute to
your source code:
[assembly: ApplicationID("your-GUID-here")]

If you don't explicitly assign an ID to the application, one will be
automatically generated. Every time it changes, the application will be
registered as a new entry in Component Services.
 
A

Alberto Poblacion

tshad said:
Would I just put the line:

[assembly: ApplicationID("c1c78e6a-2c41-469f-9976-835770b4be5f")]

after

[assembly: Guid("c1c78e6a-2c41-469f-9976-835770b4be5f")]

Is this Guid I should be using?

I don't know if using the same GUID for the ApplicationID and for the
typelib will give you any trouble. Normally, you generate a different GUID
for each of the attributes (otherwise it wouldn't be "Globally Unique",
would it?).
Also is there a way to use "regsvcs" to delete all 3 of them (or more) of
the existing objects?

I have not tried it, but you could attempt to make repeated calls to
regsvcs /u /appname:yourapplicationname. If that doesn't work, you can write
your own code to automate the removal of COM+ applications, either by means
of the RegistrationHelper class, or (if this doesn't work) by means of the
COMAdmin object. The latter is a COM object, not a managed library, but it
gives you complete control over the COM+ catalog: you can enumerate all
installed applications and then uninstall any of them.
 

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