Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Component Services / August 2005

Tip: Looking for answers? Try searching our database.

Install same assembly in more than one application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jas123@online.nospam - 03 Aug 2005 22:08 GMT
Hi
I am implementing a COM compatible C# component to control and interop
with SAN based disk arrays.
It is required that each disk array being controlled by a separate
component; this makes error recovery, among other things, much easier.
If there are, for example, two arrays of the same type there should be two
separate components each in a different COM+ app.
I used regsvcs to create COM+ application for the first instance and I can
use application config file and application root directory to let the
component know which array it owns.

For the 2nd instance, I basically, need to copy this component to a new
COM+ app.  I read that this can be done using AliasComponent method of
COMAdminCatalog2 interface.

I was wondering is there another better way to do this in .NET?
I am looking for something like this:

       Create the assembly without using <Guid>
       Copy and rename the assembly to install location
       Install and configure it as COM+ app using GUID generated at
install time
       Edit app config file to set the identity

In general is it possible to install the same assembly in GAC multiple
times with different names?

Thanks a lot
Regards
jas123
Tomas Restrepo (MVP) - 03 Aug 2005 23:52 GMT
> I am implementing a COM compatible C# component to control and interop
> with SAN based disk arrays.
[quoted text clipped - 21 lines]
> In general is it possible to install the same assembly in GAC multiple
> times with different names?

In general, no, since registering the assembly with COM+ registers it for
COM interop as well, and that's a limitation there. Your only choice in that
case would be to use aliasing, as you mention, but keep in mind it is only
available in WinServer 2003 (it can be done via de Component Services
console, though, you don't need to use the API if you don't want to).

Depending on your exact needs I might be tempted to solve this via code
generation, maybe. For example, I could put all meaningful code inside a
regular .NET assembly deployed to the GAC that is not used in COM+ at all.
That would contain all the necessary logic.

Then, I'd create a "fake" component to register in COM+ which would be a
simple class (or set of classes) that act as facades over the underlying
common library by simply forwarding the calls in it to the real
implementation classes. Since this is very simple, I could, in fact,
generate this by using a simple script (maybe even a codesmith template or a
simple script using CodeDom and templates) that takes a new
Application/Class name, generates the code for the class, and compiles the
assembly.

Having that, if I needed to support a new array, I'd just run the script
with a new name and register the generated assembly into its new COM+
application. SInce all the underlying logic is abstracted away in a single
assembly, if changes are needed I can just fix that and redeploy to the
machine's GAC.

Signature

Tomas Restrepo
tomasr@mvps.org
http://www.winterdom.com/

jas123@online.nospam - 04 Aug 2005 19:16 GMT
Then, I'd create a "fake" component to register in COM+ which would be a
simple class (or set of classes) that act as facades over the underlying
common library by simply forwarding the calls in it to the real
implementation classes. Since this is very simple, I could, in fact,
generate this by using a simple script (maybe even a codesmith template or
a
simple script using CodeDom and templates) that takes a new
Application/Class name, generates the code for the class, and compiles the

assembly.

Having that, if I needed to support a new array, I'd just run the script
with a new name and register the generated assembly into its new COM+
application. Since all the underlying logic is abstracted away in a single

assembly, if changes are needed I can just fix that and redeploy to the
machine's GAC.

Thank you for the suggestion.

Isn't this what ALiasComponent is supposed to be doing? or, does it
actually creates a copy of
the assembly?

Although your suggestion of fake component is interesting there is an
issue. In my case
the product will be installed at the customer site and fake assembly needs
to be created
during install and that requires the key file. I can;t ship the key file
with the product.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.