Posted By: Dark_Halmut | Feb 12th, 2008 @ 1:06 PM
page 1 of 1
Comments: 3 | Views: 938
I have a C# dll built for COM and its all fine for my machine. I have a sample vm setup running just XP, .net 1.1 and 2.0 to serve as a test target machine.

My legacy application is file-server(exe sits on network) and this cannot change. Doing things the right way I install my dll(and interop.xxx files) to C:\Docs and Settings\whatever\App Data\CompanyName\

Now I know I need to get the class into the GAC so that my legacy app can see it over COM. I couldn't do this straight up as the gacutil isnt part of the .net runtime(so the target machine doesnt have it). I wrote a little installer/uninstaller exe which does this using System.EnterpriseServices.Internal.Publish.gacInstall().

I made sure my dll was strongly typed via the .net command prompt doing sn -k whatever.snk and adding that to the project as the key file.

Ok, I can browse to C:\Windows\Assembly and see my class there but my legacy app still fails when creating the object on the target machine...

What gives? Sad
Dark_Halmut wrote:


So I got it to work by cd'ing to the .net 2 directory and doing

regasm "my full path to my dll\my.dll" /codebase

 

Is there a downside to this? There seems to be conflicting notation/articles out there on both of these methods.



Depends on what you are trying to do. Is you com app and c# dll in the same directory? If so use regasm with tlb option
regasm <full path>.dll /tlb:<fullpath>.tlb.
 
Don't use code base if you are going to install it in gac. More information here

http://msdn2.microsoft.com/en-us/library/tzat5yw6(VS.71).aspx
page 1 of 1
Comments: 3 | Views: 938
Microsoft Communities