jv_getmore

Hi all,

I have created .NET classes, compiled it as DLL and registered via REGASM. Regasm created TLB file, saying that "TypeLib was registered".. i also created REGfile with regasm and added it to the registry manually, BUT - the TLB specification is in fact NOT registered in the registry.

What is in the registry after using regasm:

  1. HKCR\CLSID\{GUID}\...
  2. HKCR\ClassNamespace.CLassName\...
  3. HKCR\Record\{GUID}\... (Enum declarations..)

with all above the COM interop functions fine. I can create instances of my class from ASP, etc. Thats fine.

But when i try to use <!--- META type="Typelib" uuid="{GUID}" --> (or something like this) - the asp ends up with 0223 error saying, that the TypeLib is not registered.

Actually - after using RegAsm the registry HKCR\TypeLib\{...} contains no typelib declarations specified by my DLL nor TLB.

What is not in the registry after using regasm:

  1. HKCR\TypeLib\{GUID}\...

So, what did I next was a little detective work - trying figure out how to register TLB properly.

Finally i found regtlibv12 which resides in 2.0 framework directory (%systemroot%\microsoft\framework\v2.0...\). However this "tool" is not documented at all, even has no "help" message at the command line (wtf ).

So - the only thing i am able to do now is to register the TLB file from it's location, with no clue how to set up GUID and..i must even correct the registry path, for it is incomplete.

So..my question is - is this a correct way to register TLB file How do I specify the GUID for the regtlibv12 tool

Or - Am I completly wrong or missing something - than please correct me or tell me, how to register these mysterious TLB sort of things...

Thank you,

JV




Re: Visual C# General TLB registration isue - how to register TLB with GUID with regtlibv12 or C# solution

jv_getmore

Any ideas






Re: Visual C# General TLB registration isue - how to register TLB with GUID with regtlibv12 or C# solution

jv_getmore

Not a single one Smile Still in a need for it Wink






Re: Visual C# General TLB registration isue - how to register TLB with GUID with regtlibv12 or C# solution

Mattias Sjogren

You don't specify how you used Regasm, so to ask the obvious; did you include the /tlb option when running it






Re: Visual C# General TLB registration isue - how to register TLB with GUID with regtlibv12 or C# solution

jv_getmore

Thank you for participating :-)

To answer your question - yes, i have specified the /tlb parameter.

Here is a cutout of a script Iam using while registrating the dll:

Code Block

echo *********** generating TLB ***********
%RegasmDir20%regasm %TargetFileName% /tlb:%TargetNameTlb%
IF errorlevel 1 GOTO ErrorASM
echo **************************************************************
echo ** Registering COM interop for %TargetFileName%
echo **************************************************************

%RegasmDir20%regasm %TargetFileName% /regfile:CreatedRegistry.reg
IF errorlevel 1 GOTO ErrorASM
echo Adding to registry....

regedit /S CreatedRegistry.reg

echo ************************************************************
echo * installing the Getmore.Core.tlb TypeLibrary
echo ************************************************************

%UtilsDir%regtlibv12.exe %TargetNameTlb%
IF errorlevel 1 GOTO ErrorTLB

Just for your consideration only, here is the full copy of the registration proccess of our Dlls (notice, that the "regtlibv12.exe" and other lines are just commented with REM for thes are useless for now...):

Code Block

@echo off


SET UtilsDir=utils\
SET DllsDir=dlls\
SET RegasmDir20="%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\"

SET TargetFileName=%DllsDir%Getmore.Core.dll
SET TargetName=%DllsDir%Getmore.Core
SET TargetNameTlb=%TargetName%.tlb
SET ADODBFileName=%DllsDir%ADODB.dll
SET GmConfigurationName=Getmore.Configuration
SET GmConfiguration=%DllsDir%%GmConfigurationName%.dll
SET GmCoreDBName=Getmore.Core.DB
SET GmCoreDB=%DllsDir%%GmCoreDBName%.dll
SET MSEL_COMMONname=Microsoft.Practices.EnterpriseLibrary.Common
SET MSEL_COMMONVersion=2.1.5000.0
SET MSEL_COMMON=%DllsDir%%MSEL_COMMONname%.dll
SET MSEL_OBJBname=Microsoft.Practices.ObjectBuilder
SET MSEL_OBJBVersion=2
SET MSEL_OBJB=%DllsDir%%MSEL_OBJBname%.dll
SET MSEL_DATAname=Microsoft.Practices.EnterpriseLibrary.Data
SET MSEL_DATAVersion=2
SET MSEL_DATA=%DllsDir%%MSEL_DATAname%.dll


SET GAC_FILE=%TargetFileName%
echo ************************************************************
echo * installing the %GAC_FILE% to the GAC
echo ************************************************************
echo running GACUTIL on file %GAC_FILE%
%UtilsDir%gacutil /if %GAC_FILE%
IF errorlevel 1 GOTO ErrorGAC

SET GAC_FILE=%ADODBFileName%
echo ************************************************************
echo * installing the %GAC_FILE% to the GAC
echo ************************************************************
echo running GACUTIL on file %GAC_FILE%
%UtilsDir%gacutil /if %GAC_FILE%
IF errorlevel 1 GOTO ErrorGAC

SET GAC_FILE=%GmConfiguration%
echo ************************************************************
echo * installing the %GAC_FILE% to the GAC
echo ************************************************************
echo running GACUTIL on file %GAC_FILE%
%UtilsDir%gacutil /if %GAC_FILE%
IF errorlevel 1 GOTO ErrorGAC

SET GAC_FILE=%GmCoreDB%
echo ************************************************************
echo * installing the %GAC_FILE% to the GAC
echo ************************************************************
echo running GACUTIL on file %GAC_FILE%
%UtilsDir%gacutil /if %GAC_FILE%
IF errorlevel 1 GOTO ErrorGAC

SET GAC_FILE=%MSEL_COMMON%
echo ************************************************************
echo * installing the %GAC_FILE% to the GAC
echo ************************************************************
echo running GACUTIL on file %GAC_FILE%
%UtilsDir%gacutil /if %GAC_FILE%
IF errorlevel 1 GOTO ErrorGAC

SET GAC_FILE=%MSEL_OBJB%
echo ************************************************************
echo * installing the %GAC_FILE% to the GAC
echo ************************************************************
echo running GACUTIL on file %GAC_FILE%
%UtilsDir%gacutil /if %GAC_FILE%
IF errorlevel 1 GOTO ErrorGAC

SET GAC_FILE=%MSEL_DATA%
echo ************************************************************
echo * installing the %GAC_FILE% to the GAC
echo ************************************************************
echo running GACUTIL on file %GAC_FILE%
%UtilsDir%gacutil /if %GAC_FILE%
IF errorlevel 1 GOTO ErrorGAC

rem echo *********** Exporting Typed Library ***********
rem %UtilsDir%tlbexp %TargetFileName%


REM echo *********** generating TLB ***********
REM to generate a TLB file: (it is not needed for it is pre-generated )
REM %RegasmDir20%regasm %TargetFileName% /tlb:%TargetNameTlb%
REM IF errorlevel 1 GOTO ErrorASM
echo **************************************************************
echo ** Registering COM interop for %TargetFileName%
echo **************************************************************
%RegasmDir20%regasm %TargetFileName% /regfile:CreatedRegistry.reg
IF errorlevel 1 GOTO ErrorASM
echo Adding to registry....
regedit /S CreatedRegistry.reg

REM = TypeLib is not registering yet!
REM echo ************************************************************
REM echo * installing the Getmore.Core.tlb TypeLibrary
REM echo ************************************************************

REM %UtilsDir%regtlibv12.exe %TargetNameTlb%
REM IF errorlevel 1 GOTO ErrorTLB


REM ***************************************
REM OVERENI ZDA SE NEJEDNA O WINDOWS VISTA - pokud ano, je nutno zapsat do registru klic s casovymi zonami
REM ***************************************

VER > windows_version.txt
FINDSTR "6.0" windows_version.txt
IF %ERRORLEVEL% EQU 0 GOTO WINDOWSVISTA
GOTO VER_END

:WINDOWSVISTA

echo ****************************************************************************
echo * Running OS Windows Vista timezones registry fix
echo ****************************************************************************
regedit /S res\Getmore_TimeZones_registry_fix.reg
IF errorlevel 1 GOTO ERRORTIMEZONESREGISTRY

GOTO VER_END

:VER_END

DEL windows_version.txt

GOTO CSharpEnd

:ERRORTIMEZONESREGISTRY
echo Can't add windows vista timezones registry fix to registry....
PAUSE
EXIT 1

:ErrorASM
echo can't register files via REGASM...
PAUSE
EXIT 1


:ErrorGAC
echo Project error: can't install file [%GAC_FILE%] to the GAC!
PAUSE
EXIT 1

:ErrorTLB
echo Project error: can't register TypeLibrary classes!
PAUSE
EXIT 1

:CSharpEnd


echo Successfully!


PAUSE

Sorry for a long post, i would add an attachement wish only to know how :-)