Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 31st, 2006, 02:12 PM
Registered User
 
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to wizardjagon Send a message via MSN to wizardjagon Send a message via Yahoo to wizardjagon
Default Deploying C# COM Interop

I've created a C# COM Interop Dll which inteferces with ASP and a 3rd Party .NET assembly. On my local machine .NET takes care of the registration of the component and ASP knows how to create the Component and everything works great. When I deploy this to another server it doesn't seem to work and the Server.CreateObject function gets an error while trying to create the component. Does anyone know how to register the COM interop Dll on a remote server so that ASP can create the DLL? Is there anything special I need to do when moving the 3rd party DLL to the server?

 
Old January 31st, 2006, 03:08 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

Register the 3rd party Dll on the server, if its not already.
Just execute this command on the command prompt on the server

regsvr32 <your3rdParydllwithpath.dll>

If you are responsible for deploying the app,
it would be best if you include the registeration
process in the setup.

Regards
Ankur Verma
 
Old January 31st, 2006, 03:20 PM
Registered User
 
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to wizardjagon Send a message via MSN to wizardjagon Send a message via Yahoo to wizardjagon
Default

Figured it out.

Needed to run gacutil /i <DLL path/file> for my component
              gacutil /i <DLL path/file> 3rd party .NET component
              regasm <DLL path/file> /regfile on my dll and creates
as regsitry file. Run the registry file loading the data to the registry. Make sure to run iisreset and it worked.

 
Old January 31st, 2006, 03:32 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

If you have the 3rd party Dll with you, which i believe is a COM
dll then you dont have to go thru all that. You are sort of reversing
the process here to register a component for which you also have a RCW
(Runtime Callable Wrapper). Although its working for, do explore the
shorter route as well.

Regards
Ankur
 
Old February 1st, 2006, 04:37 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

You can run regasm.exe against the dll using the /regfile option. try regasm /? at the VS command prompt for exact syntax. This creates a registry file which can be run on the target machine and makes it appear to the machine that the assembly is a COM class.


--

Joe (Microsoft MVP - XML)





Similar Threads
Thread Thread Starter Forum Replies Last Post
C# and Interop.ShockwaveFlashObjects TheBigOnion C# 0 December 19th, 2006 12:27 PM
com interop CenT C# 1 October 6th, 2006 08:45 AM
How to use COM Interop in C# Nataraj1978 C# 2005 0 February 17th, 2006 02:49 AM
Interop Problem Yehuda General .NET 0 July 1st, 2004 08:57 AM
Interop Troubles Yehuda Pro VB.NET 2002/2003 0 June 29th, 2004 01:26 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.