COM+ (MTS) deployed at client.

Posted on 2004-12-01
Last Modified: 2011-10-03
I am developing on 3-tire application, where register all the component on server (Business Layer) and deployed the MSI file exported from package of Component Service on client machine.

but what i am not able to get is as i deploy the MSI file on client machine it also intall the DLL compont on the client machine, then if any change occure or any break in ActiveX version my client application is not able to access it.

Might be i am bit confusing, please explain where i am wrong or provide some usefull link.

Thanks in advance.

Amit Jain
Question by:amit1978
    LVL 10

    Expert Comment

    You should not install the DLL on tClient machine. If this is happening you have the wronk kind of MSI (Server Application). When exporting (creating the MSI) from COM+ on the server machine, you should create an Application Proxy MSI. The client machine should not have the DLL registered at all before running the MSI  - if it does uninstall the current MSI/unregister the DLL. Every time you upgrade the public interface(s) of your COM+ component, you need to rexport and redeploy the MSI, (uninstalling the previous one first). On your development machine, you will have trouble if you try and run the COM+ component in debugger locally if you have the proxy stub registered. Also as stated previously you may have trouble registering the proxy stub if you have the dll registered. The act of compiling in VB automatically registers your control.

    Other things to note:

    COM+ objects should be developed with Binary Compatibility set.
    COM+ objects work best when they are stateless, i.e. do not hold their own data.
    LVL 5

    Author Comment

    Hi thanx for response.

    could u pls let me know step and setting to be done for exporting and inporting the MTS package. its realy good if u provide some usefull like too.

    meanwhile i do some RND(tests) on COM+ feature and so.

    LVL 10

    Accepted Solution

    This is what I do. It seems to work.

    Before starting, it is a good idea to remove all registry references to the COM+ dll or it's proxies from all machines involved (client/server/development).

    For the purposes of this example the dll file will be called Example.dll

    Part 1 Creating a COM+ component.
    * Make sure that Project/Properties/Component/Binary Compatibility is set.
    * Check Project/Properties/Component/Remote Server Files
    * Compile your DLL (for this example into C:\Dev\Example)
    * Run
            regsvr32 /u C:\Dev\Example\Example.dll
            - to remove the dll reference from the registry - this step is to allow testing of the MSI on the development machine.

    Part 2 Creating a package
    * Copy your Example.dll and Example.tlb (Example.tlb was produced when Example.dll was compiled)  to a directory on the COM+ server (for this example, C:\Public\ComPlusDlls)
    * On the COM+ server, open Component Services
    * In the console treeview, select Console Root/Computers/My Computer/COM+ Applications.
    * Right click on COM+ Applications in the treeview.
    * In the menu select New/Application.
    * In the wizard: Create an Empty Application/Server application.
    * Enter the name of your COM+ application (Example)
    * Select "This user" and enter the Administrator Username and Password and Finish.
    * Open the Treeview entry "../Example/Components".
    * Right Click on Components node and selext New/Component from the menu.
    * In the Wizard:Install New Components
    * Browse to C:\Public\ComPlusDlls and select Example.dll and Example.tlb. Click Next/Finish

    Your component should be set up in your package.

    Part 3 Exporting a package (for application proxy)
    * Select the Treeview entry "../Example", Right-click it.
    * From the Menu select Export
    * In the wizard select Export As Application Proxy
    * Browse to a directory (in this example: C:\Public\ClientMSI) and  enter a filename (e.g. Example.msi)

    Part 4 Importing the Proxy stub
    On the Client machine:
    * Uninstall the previous version of Example.msi
    * Get a copy of the new
    * Install the new Example.msi.

    The client machne now has a proxy stub installed.
    If you look inside "..\Program Files\ComPlus Applications" you will find at least one folder. Each folder in here is named with the GUID of the COM+ package. If you open the folder, each one contains at least one type library file (*.tlb). If you look you should find your tlb file.
    LVL 5

    Author Comment

    ok i have missed

    * Check Project/Properties/Component/Remote Server Files

    Thanx ..... but could u give me some usefull site where i can get some usefull information regarding COM Plus(MTS) and point keep in mind for developing and deploying COM+ component(i have clear fundamental of activeX).

    like transaction mode(supported, required, required new....)

    Also some tipical interview question help me.
    LVL 5

    Author Comment

    >>>>>>>>>>>points increased.<<<<<<<<<<<<<<<
    LVL 5

    Author Comment

    and also if DLL is running on server then its something like out of process component then what the difference between ActiveX DLL and EXE.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
    Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    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…

    733 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now