1

I can use the following command on a .net 4.8 built DLL without error.

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\regasm /codebase TLC.System.Logger.dll /tlb:TLC.System.Logger.tlb

but soon as i use command on a .net 6.0 built DLL i get the following error:

RegAsm : error RA0000 : Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

There doesn't seem to be a regasm.exe equivalent on .net 6.0 runtime or sdk.

Is there a certain way of doing this on .net 6.0?

Paul Good
  • 31
  • 3
  • Regasm.exe is no longer used in .NETCore, use Regsvr32.exe. https://stackoverflow.com/a/57646516/17034 – Hans Passant Jan 04 '22 at 14:56
  • But how does Regsvr32.exe generate a TLB file? – Paul Good Jan 04 '22 at 16:08
  • One workaround is to build offending DLL to say .NET4.8 framework and use regasm on that. – Paul Good Jan 04 '22 at 16:56
  • (1) You need to generate a tlb file for a 4.7 build using regasm.exe (2) Use the tlb generated in (1) and build that into the solution for a net6.0 build. (3) Add build configuration to generate a comhost DLL. (4) Use regsvr32 on DLL built in (3) – Paul Good Jan 31 '22 at 19:40

0 Answers0