Solved

How To register 2 copies of the same component on the same server

Posted on 2004-10-07
6
140 Views
Last Modified: 2010-05-02
I know it could sound weired, but as we have 2 test environments one uses the current production version of DLL, and on the same server we have another test session running concurrently that tests an updated version of the same DLL. I want to enable the first stream of test to go against the current copy that is in production (testing something before loading it in production), and at the same time in another project we made enhancement to the same DLL, and we want to test it concurrently with the first stream. How Can I register the 2 (binary compatible - same name - different locations on the same server) dlls. we are registering them on the client machines as COM+ components.
Please do not suggest a change of the test process, it is out of control. Is there a trick to do that (like virtual servers ...etc) thanks.
I know it is a hard question, so I will give it the maximum points.
0
Comment
Question by:fmichail
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 19

Accepted Solution

by:
Shauli earned 500 total points
ID: 12254019
You can't :)

As a rule of thumb, you should make your dll always compatible backward, which will enable previous versions to work with the dll, although it has new functionalities that work with the new version. If you do that, then you can use the same dll for both version.

What you can do, if you must, is create a new dll, and use two different dlls.

S

0
 
LVL 18

Expert Comment

by:JR2003
ID: 12254567
If they are binary compatible they will have the same GUID so you can't get your test environment to pick up different ones. Cold you break the binary compatability and compile one set of test code against the old one and another set of code against the new one then they will pick up the ones they have been compiled against so you can run your concurrent tests?

JR
0
 
LVL 6

Expert Comment

by:SCDMETA
ID: 12256010
Technically, you can....given some assumptions.

I just created a simple application and dll to test it and I successfully ran two versions of the same dll.
I don't know how it wil work with COM+, but maybe this will give you some ideas.

Regsvr32 version 1 of the dll
Load app1.
Assuming early binding, the version1 dll is loaded in process.
Keep app1 running.

Regsvr32 version 2 of the dll.  
Load app2. It will load version 2 of the dll.
Keep app2 running.

As long as the applications remain running they should use their in process version of the dll.
If you use late binding, then I assume this will not work.


0
 
LVL 17

Expert Comment

by:inthedark
ID: 12256726
One of the problems with testing is that it is hard to overwrite a dll once if has been used by com+, it seems to get locked. So you end up having edit the project name like MyDLLV10 becomes MYDLLV11.  In your test program you can either reference then new DLL or you can remove the reference completly and test using late binding. So when testing DLL's for example I pass the project name as a parameter in the url or as a parameter in some ini file.  This works if you are using the same server that you created the dll on, if you are testing from a remote workstation it is a little harder as you ned to regersiter the MyDLLV11.TLB on the calling workstation so it becomes a pain.
0
 

Author Comment

by:fmichail
ID: 12588866
Dear Shauli

I do not mean your answer is not OK, but you are giving me the solution that I currently use, but in fact I expected some one to guide me to something New like "Virtual server". Virtual server I beleive could be the best solution, because you will have (I think) multi servers on the same server, and on each you can register the different Dll (which are binary compatible but have different code). on the machine you have 2 short cuts one against each copy of the main exe., and on the server you will have 2 copies of the main application each is compiled against the component in its own "Virtual server". I will try to be more specific:
Virtual 1 has
      MyApp1.EXE      pointing to the component MyDLL.DLL (of course on the same virtual server)

Virtual 2 has
      MyApp2.EXE      pointing to the component MyDLL.DLL (of course on the same virtual server, but the code in this dll is different, although it has the same name)

On the test PC we will have one shortcut pointing to MyApp1.EXE      , and onother to MyApp2.EXE      .

I am not stating that this is the solution (simply because you still need to register the 2 dlls on the same test machine, although they have the same GUID), but that was the chalenge in the question which made me give it the highest points.

your solution will work (of course), and that is why I think you are the nearest answer. Thanks to all of you experts.
sorry for being late.


 
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question