{"id":80,"date":"2020-11-09T04:12:37","date_gmt":"2020-11-09T04:12:37","guid":{"rendered":"https:\/\/aabirtech.com\/shiblenomanblog\/?p=80"},"modified":"2022-09-28T14:04:19","modified_gmt":"2022-09-28T06:04:19","slug":"register-dll-in-windows","status":"publish","type":"post","link":"https:\/\/aabirtech.com\/shiblenomanblog\/2020\/11\/09\/register-dll-in-windows\/","title":{"rendered":"Register managed DLL in Windows"},"content":{"rendered":"\n<p>Registering a managed DLL file can be simple process if you know the correct .NET version. Registering process is slightly different for 32, 64 bit and .NET version. There is no straight way to know .NET version, using a tool like <a rel=\"noreferrer noopener\" href=\"https:\/\/www.telerik.com\/products\/decompiler.aspx\" target=\"_blank\">JustCompile<\/a> is useful to get the .NET version, also shows internal properties and method regarding the DLL.  <\/p>\n\n\n\n<p>Once we know the .NET version and 32 or 64 bit variant of the DLL, we need to run windows command prompt in elevated mode. If the .NET version is 2.0 and 32 Bit, run this command below &#8211; <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\RegAsm.exe &lt;absolutePathToYourDLL.dll&gt; \/register \/codebase \/tlb<\/code><\/pre>\n\n\n\n<p>To register a 64 bit assembly, simply need to refer to 64 bit framework<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727\\RegAsm.exe &lt;absolutePathToYourDLL.dll&gt; \/register \/codebase \/tlb<\/code><\/pre>\n\n\n\n<p>Above command will generate a .tlb (typeLibFile) and \/codebase basically register the assembly globally. <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/framework\/tools\/regasm-exe-assembly-registration-tool\" data-type=\"URL\" data-id=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/framework\/tools\/regasm-exe-assembly-registration-tool\">Here<\/a> you can find documentation. <br><br>To register a .NET 4 and 32 bit assembly run the command below &#8211; <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\regasm.exe &lt;absolutePathToYourDLL.dll&gt; \/register \/codebase \/tlb\n\nC:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\regasm.exe &lt;absolutePath.dll&gt; \/register \/codebase \/tlb<\/code><\/pre>\n\n\n\n<p>To unregister .NET 2.0 DLL run below command <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\RegAsm.exe &lt;absolutePath.dll&gt; \/unregister<\/code><\/pre>\n\n\n\n<p>In the same way to unregister a .NET 4.0 assembly, run the command below <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\regasm.exe &lt;absolutePath.dll&gt; \/unregister<\/code><\/pre>\n\n\n\n<p>Hope it will help you. <\/p>\n\n\n\n<p>Happy coding \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Registering a managed DLL file can be simple process if you know the correct .NET version. Registering process is slightly different for 32, 64 bit and .NET version. There is no straight way to know .NET version, using a tool like JustCompile is useful to get the .NET version, also shows internal properties and method [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":84,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16],"tags":[12,13,15],"class_list":["post-80","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dll-assembly","tag-net-2-0","tag-net-4-0","tag-register-assembly-dll"],"acf":[],"_links":{"self":[{"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/posts\/80","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/comments?post=80"}],"version-history":[{"count":5,"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/posts\/80\/revisions"}],"predecessor-version":[{"id":149,"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/posts\/80\/revisions\/149"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/media\/84"}],"wp:attachment":[{"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/media?parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/categories?post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aabirtech.com\/shiblenomanblog\/wp-json\/wp\/v2\/tags?post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}