Usage of "dscom32.exe tlbexport" with "--asmpath" and "dscom32.exe regasm" problems
dscom32.exe tlbexport C:\temp\net8.0-windows\SigIDpActiveX.dll --out "C:\temp\net8.0-windowsSigIDp-R.tlb" --tlbrefpath "C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\8.0.15" --tlbreference System.Windows.Forms.dll --verbose Access is denied.
I executed this command on a VS2022 command line with admin right.
dscom32.exe tlbexport C:\temp\net8.0-windows\SigIDpActiveX.dll --out "C:\temp\net8.0-windowsSigIDp-R.tlb" --tlbrefpath "C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\8.0.15\ref\net8.0" --tlbreference System.Windows.Forms.dll --verbose dscom : warning TX00000000 : Type library exporter encountered an error while processing 'SigIDpActiveX'. Error: Could not load file or assembly 'System.Windows.Forms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified. Interface '_SigIDp' exported. Class 'SigIDp' exported. Struct 'Variant' exported.
The options --tlbreference and --tlbrefpath are not applicable for this task.
This options are only necessary if your want to load additional TLBs.
In the case of System.Windows.Forms.dll there is no tlb available.
To define a folder containing assemblies to load, you should utilize the --asmpath option. This ensures the tool can correctly locate the required assemblies and export the TLB as intended.
As example:
dscom32.exe tlbexport C:\temp\net8.0-windows\SigIDpActiveX.dll --out "C:\temp\net8.0-windowsSigIDp-R.tlb" --asmpath "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\8.0.15\ref\net8.0"
Or any other folder that contains the “System.Windows.Forms.dll”, depending on your .NET SDK installation
c:\temp\net8.0-windows>dscom32.exe tlbexport C:\temp\net8.0-windows\SigIDpActiveX.dll --out SigIDp-R.tlb --asmpath "C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\8.0.15" --verbose Access is denied. and Windows 10 pup up a blue color dialog "This app can't run on your PC, To find a version for your PC, check with the software publisher", I ran it with admin right.
Retry it with:
dscom32.exe tlbexport C:\temp\net8.0-windows\SigIDpActiveX.dll --out "C:\temp\net8.0-windowsSigIDp-R.tlb" --asmpath "C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.15"
dscom32.exe regasm C:\temp\net8.0-windows\SigIDpActiveX.dll --asmpath "C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.15" --codebase This command completed without any error, but the registry InProcServer32 folder does not have default key point to the SIgIDpActiveX.dll path, any idea? Above C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App\8.0.15 folder have x64 dlls
I have no clue. @mavToday is the "regasm" feature supported for 32Bit? Or is this a limitation?
Yes, for sure. We use it espacially with 32Bit.
You should reference the 32 Bit Dlls, like C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App
and we use the switch '--tlb' but looks like it is not necessary. We need the TypeLib for VB6 Integration.
But you have ComVisible-Types for sure? And in which Path do you search in the registry?
Maybe I am confused, but running dscom32 with an 64-bit asmpath shouldn't be able to work. Because the 32-bit assemblies can't read or open the 64-bit assemblies located in the asmpath.
@SOsterbrink I don't think you're confused. ;-) It depends on whether the assembly is AnyCPU or X86/X64 compiled.
THX @mavToday for the hint!
@oliverlan retry it with:
dscom32.exe regasm C:\temp\net8.0-windows\SigIDpActiveX.dll --asmpath "C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App\[your version]" --codebase
... and five us feedback
My project setting is to build an x86 activex. I attached tlbdump file and the registry screen shot that shows the registry has partial information regarding to this activex.
Thanks Oliver
From: Patrick Tusch @.> Sent: Wednesday, April 23, 2025 11:46 PM To: dspace-group/dscom @.> Cc: Oliver Lan @.>; Author @.> Subject: Re: [dspace-group/dscom] Usage of "dscom32.exe tlbexport" with "--asmpath" and "dscom32.exe regasm" problems (Issue #351)
[https://avatars.githubusercontent.com/u/76785562?s=20&v=4]mavToday left a comment (dspace-group/dscom#351)https://github.com/dspace-group/dscom/issues/351#issuecomment-2826551978
Yes, for sure. We use it espacially with 32Bit.
You should reference the 32 Bit Dlls, like C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App
and we use the switch '--tlb' but looks like it is not necessary. We need the TypeLib for VB6 Integration.
But you have ComVisible-Types for sure? And in which Path do you search in the registry?
— Reply to this email directly, view it on GitHubhttps://github.com/dspace-group/dscom/issues/351#issuecomment-2826551978, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABTLRSUBNMMTRFGKOZRPCET23CCDFAVCNFSM6AAAAAB3UZQN6KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMRWGU2TCOJXHA. You are receiving this because you authored the thread.Message ID: @.***>
In your project is a control, that you want to register as an ActiveX-Component? I know that in this case there should be some more entries in the registry, but as far as i know, regasm.exe would not create them on their own. Or does it respect the ComRegisterFunctionAttribute and ComUnregisterFunctionAttribute?
I would like to close the issue. Please let me know if there are any outstanding concerns or if we can proceed with closing it.