1

I have written a .net dll that I can successfully call from vb6. Deployment to xp, vista 32, and vista 64 boxes have been working. It is not working on windows 7 64 bit. I cannot run regasm.exe /codebase name.dll on the end users machine because they are not admins.

Currently my app is deployed in the "c:\Program Files (x86)\application name" directory.

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
sparkkkey
  • 158
  • 1
  • 10

3 Answers3

2

I'm using registration free COM to access the .NET interop assemblies.

Basicly first you have to create assembly manifest with mt.exe and optionally re-sign strong names with sn.exe like this

mt.exe -managedassemblyname:{Your_DLL} -nodependency -out:{Your_DLL}.manifest
mt.exe -manifest {Your_DLL}.manifest -outputresource:%{Your_DLL};1
sn -Ra {Your_DLL} {Your_PFX}

Then reference this assembly manifest in your application manifest like this

<dependency>
    <dependentAssembly>
        <assemblyIdentity name="{Your_DLL}" version="1.0.0.0" publicKeyToken="hash_here" processorArchitecture="x86" />
    </dependentAssembly>
</dependency>

where assemblyIdentity matches assemblyIdentity in assembly manifest of {Your_DLL}.

On client machines both the VB6 executable and .NET dll must be in the same folder. No regasm and no GAC registration needed.

I'm using UMMM tool to automate the manifest creation process but you can do it manually if it's a one time setup.

wqw
  • 11,771
  • 1
  • 33
  • 41
  • I agree that Reg free comm is the best way to handle this. We have been having a few issues. It is still my long term goal. I will try out the UMMM tool. – sparkkkey Feb 19 '10 at 17:49
  • I was able to use the mt and sn commands listed above to get reg free comm to work. Thanks for the help! – sparkkkey Feb 22 '10 at 20:40
1

I solved this by running regasm with the /regfile option, and replacing HKLM with HKCU in the resulting .reg file.

If you need more precise instructions, let me know.

Community
  • 1
  • 1
SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
  • Thanks for the response. Is it working on Windows 7 64 bit? I replaced HKLM with HKCU\Software\Classes\Wow6432Node. This works on vista 64 but not windows 7 .... I suspect Wow6432Node issues. – sparkkkey Feb 18 '10 at 23:02
  • Thanks for the help SLaks. I read that Wow6432Node was necessary to run since the vb6 app is 32 bit. I will remove it and give it a try. – sparkkkey Feb 18 '10 at 23:40
  • I took an axe to Wow6432Node and it started working on win7 64 bit. Thanks for the help! – sparkkkey Feb 19 '10 at 17:47
  • Just in case anyone is interested I have built a small powershell script that is run automatically in the build. VMIS is the name of the program. VMISLIB.dll is the name of the .net dll. – sparkkkey Feb 19 '10 at 17:55
  • #this will only work on a 64 bit box because of the x86 file path #run regasm and create initial file cd "\Program Files (x86)\VMIS" & 'C:\Program Files (x86)\VMIS\RegAsm' /regfile /codebase VMISLIB.dll #create file for 32 bit machines $file1 = "C:\Program Files (x86)\VMIS\VMISLIB.reg" $file2 = "C:\Program Files (x86)\VMIS\VMISLIBdeploy.reg" $match = "HKEY_CLASSES_ROOT" $replacement = "HKEY_CURRENT_USER\Software\Classes" $content = Get-Content $file1 $content = $content -creplace $match,$replacement $content | Set-Content $file2 – sparkkkey Feb 19 '10 at 17:55
  • #take out the x86 stuff for a 32 bit box $match = " \\(x86\\)" $replacement = "" $content = Get-Content $file2 $content = $content -creplace $match,$replacement $content | Set-Content $file2 – sparkkkey Feb 19 '10 at 17:55
0

Deployment requires admin rights. It's supposed to fail in this case.

Steven Sudit
  • 19,391
  • 1
  • 51
  • 53