I have an ASP Classic application which references some VB6 COM OBJECTS. One of these VB6 COM OBJECTS reference another 3rd Party .Net DLL.
The 3rd party .Net DLL needs to be registered on a Windows Server 2008 R2 x64 machine.
I have found scripts to register the DLL in the GAC without GACUTIL using powershell (ref: http://weblogs.asp.net/adweigert/archive/2008/10/31/powershell-install-gac-gacutil-for-powershell.aspx)
Now I need to register the assembly. I have used both the GACUTIL and the REGASM on my local development machine (x86) without hitch. But when I try to get the DLL on the testing server I have problems.
First issue : NO GACUTIL
There is no GACUTIL on the server, which I got around using script noted above. I understand that it can be installed using the SDK but I do not want to “pollute” the environment.
Second issue : REGASM CANNOT FIND ASSEMBLY
The REGASM under the 32bit .Net Framework does not find the DLL. Error reported: “RegAsm : error RA0000 : Unable to locate input assembly ‘C:\Windows\System32\xxxxx.dll’ or one of its dependencies.”
So I used the 64bit variant of RegAsm and that worked.
My concern though is that it is a false positive in that the ASP classic does not find the assembly as it is not registered by the 32bit RegAsm.
I run my application I get errors in my event log: “ActiveX component can’t create object”. Generally speaking that happens because it cannot find the object to create, which means that the DLL hosting the object is not registered correctly.
So what I am trying to do now is find out if there is an alternate method to REGASM using powershell that will register the assembly in the 32Bit scope.
Does anyone know if that is possible and what the script would be to get it right?
I found out that I was placing the .Net DLL in the incorrect folder on the test machine for registration.
On a windows 64Bit OS you have the System32 and the SysWOW64 folders. I placed my DLL in the System32 folder, where it should have been in the SysWOW64 folder.
The error I got from RegAsm (“RegAsm : error RA0000 : Unable to locate input assembly ‘C:\Windows\System32\xxxxx.dll’ or one of its dependencies.”) should have made me click but I missed it.
Basically the 32 Bit RegAsm could not find my DLL but the 64 bit RegAsm could find my file and by registering the assembly with the 64 bit RegAsm I was putting the DLL into 64 bit scope. I needed it to be in 32 Bit scope.
I moved the DLL form System32 to SysWOW64 and the 32bit RegAsm found the DLL and registered it within the 32 Bit scope.
Now my VB6 COM object can find the .Net DLL and it works with out the error “ActiveX component can’t create object”.
With all that said, I have not found a library or function that will do the same job as RegAsm without actually using RegAsm.
If anyone finds this mythical beast please reply to this question. Thanks in advance.