Monday, November 06, 2017

Migating Com+ component from one server to another

I recently migrated a windows 2008 web server to windows 2016.  One of the glitches that I failed to notice right away was that one of my website was using an old Com+ component.  The component was written in ancient vb.net  and while I still have the source code I didn't want to start rewriting everything just yet.  Besides it was useful for the security of the site as the component had its own identity and limited use to the database it was accessing.  After considerable trial and error these are the steps required for it to work.  For this example we'll call the component mycomp.dll.

1.  Register the component in the GAC of the server.  I thought I had a 32 bit/64 bit conflict but in the end I was able to register it as a 64 bit component.
    a.  Copy  the dll, tlb, xml, pdb files to Windows\System32 directory.
    b.  Open an elevated command prompt and navigate to the latest .net framework, which in my case was:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319
   c.   Register the file in GAC using the command:
         RegAsm.exe c:\windows\System32\mycomp.dll

 2.   Now you can add the component to a com+ application

a.  Open in Administrative tools the component services snap in.
b.  open the console Root tree Component services-> Computers->  My Computer
c.  right click on COM+ Applications  and select new
d.  Click through the wizard and select Create Empty  
Application. 
f.  Finish the wizard configuring the application as required by your needs.
g.  When finished open up the COM+ Applications in the console root
h.  Expand the application you just created and right click on Components
i.  Select new -> Component.  The wizard opens and click next
j.  select install new component (very important)
k.  a file dialog will open, select mycomp.tlb.  and click through the wizard adding whatever roles you need for the component.
l.  Back in the console tree open the components, open the component you just added and open the roles.
m.  Right click on the role you created and click new user.  This will open a dialog where you can add users.  (Note If you select the interactive user as owner of the com+ application this may not be necessary. )

 Now you have an application that should work on the new server.







0 Comments:

Post a Comment

<< Home