Step 1: Open the Visual Studio 2005 Command Prompt and go to
the bin directory of the project.
C: \COMPlusObject\COMPlusObject\bin>
Step 2: Execute the following command at the command prompt.
C: \COMPlusObject\COMPlusObject\bin> regsvcs release\COMPlusObject.dll
The console window will show the message given below.
Figure 4: Registering assembly as the COM+
component using VS command prompt
Ignore the warning message since we did not bother about COM
security in this example. You can see the files inside the release folder now.
It must have added a new file named COMPlusObject.tlb.
Figure 5: Files in release folder after registering
assembly as COM+ component
If you want, you can know about these file types (.pdb and
.tlb) in the msdn help.
At this moment the .NET managed assembly COMPlusObject.dll
is installed and will be running a COM+ component in the system. Let us verity
whether it is really installed in the COM list.
To verify the installation of component service:
Step 1: Open the Component Services window Control Panel
>> Administrative Tools >> Component Services.
Step 2: In the tree view panel, expand the nodes in
following order: Component Services >> Computers >> My Computer
>> COM+ Applications.
Figure 6: Verifying installed COM+ application in
Component services window
All child nodes under COM+ applications are installed COM+
components. In this list you can see a node named "MyCOMService"
which is the application we are looking for. Note that the application named
"MyCOMService" is the same one we set in the assembly attribute
earlier.
Step 3: Expand MyCOMServices >> Components, now you
will see:
Figure 7: Showing .NET object installed as COM+
component in the system
Then we are sure here that our assembly is installed as a
COM+ service. Isn’t it? OK, this is installed but what next? Is it now
accessible to other application like VB6, Access, ASP, ASP.Net web applications,
etc? Yes, it should. Let us go for testing it. Next, I am going to show you the
procedures to consume the COM+ component in pure ASP page and also in Access
application.