Computer >> Computer tutorials >  >> System >> windows

What is RegAsm.exe? How to Unregister a DLL Using RegAsm.exe?

In this post, we explain what is RegAsm.exe, how to register or unregister a DLL using RegAsm.exe, and how RegAsm.exe is different from Regsvr32.exe.

What is RegAsm.exe? How to Unregister a DLL Using RegAsm.exe?

What is RegAsm.exe in Windows 11/10?

RegAsm is the short form of Register Assembly. RegAsm.exe is a genuine component of Windows developed by Microsoft. RegAsm.exe opens the Assembly Registration tool. When the Assembly Registration tool is opened, it reads the metadata within an assembly and adds the necessary entries to the registry. RegAsm.exe is only responsible for opening the Assembly Registration tool. It does not pose any threat to your PC. However, there are some instances where some malware is camouflaged as RegAsm.exe.

The Assembly Registration tool reads the metadata within an assembly and adds the necessary entries to the registry, which allows COM clients to create .NET Framework classes transparently. Once a class is registered, any COM client can use it as though the class were a COM class. The class is registered only once, when the assembly is installed. Instances of classes within the assembly cannot be created from COM until they are actually registered.

Is RegAsm.exe malware?

Occasionally, the antivirus programs on our computer may flag some important system file of Windows OS as threats. It could be a false positive or it could happen if malware is masquerading as an OS file by taking the same name. This can happen with RegAsm.exe too!

If you have installed any program that is pirated and your antivirus flagged RegAsm.exe, then:

  1. Uninstall the pirated program completely without any traces of it
  2. Scan your PC with antivirus and anti-malware program
  3. Delete the pirated installers or files related to it from your PC

This way you can get back your PC to normalcy.

To avoid malware-infected RegAsm.exe getting into your PC, don’t install pirated Microsoft Office, or Windows, or any other programs for that matter. This is the only way you can avoid the malware and make your PC secure.

How to Unregister a DLL using RegAsm.exe?

To run the tool, use Visual Studio Developer Command Prompt or Visual Studio Developer PowerShell. Unregistering a DLL using RegAsm.exe is so easy as registering.

Open Command Prompt and run the following command replacing the <dllfilename> name with the name you want to unregister.

regasm /u <dllfilename>.dll

To unregister the DLL completely, you have to unregister the type library of the DLL too. To do so, run the following command.

regasm <dllfilename> /tlb /unregister

How is RegAsm.exe different from Regsvr32.exe?

Regsvr32.exe is a command-line tool that is used to register DLLs and ActiveX controls in the registry. Meanwhile, RegAsm.exe makes registry entries to make .NET components look like COM components. RegAsm.exe comes with the .NET SDK.

What is Regasm Codebase?

RegAsm Codebase command line is used to create an entry for codebase in the registry. The codebase entry in the registry specifies the path for the assembly that is not installed on the global assembly cache. The global assembly cache stores assemblies on your PC that are used by multiple programs. The assembly file for which you use the codebase must be a strong-named assembly to avoid conflicts with others in the global assembly cache.

We hope you learned something new here today.

What is RegAsm.exe? How to Unregister a DLL Using RegAsm.exe?