How to do RegAsm so that it cover 32-bit and 64-bit?

有些话、适合烂在心里 提交于 2019-12-18 07:29:13

问题


I have a DLL file prepared by C# and my system is Windows 7 64-bit. When i apply the RegAsm its not adding the registry to 64-bit path but only adding it to 32-bit path.

"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe" /register /codebase "C:\o.dll"

then if i check my GUID in regedit.exe i see that i have it only in 32-bit registry path: HKEY_CLASSES_ROOT\CLSID\{... my guid is found here ....}

instead of HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{... not found my guid ...}

As a result i have other issues for this. Can anyone please suggest what is going on and why its not making 32-bit and 64-bit registry entries?"


回答1:


You have it backwards. The Wow6432Node is where the 32-bit specific data goes. Use the 32-bit regasm (from the Framework directory, not the Framework64 directory) to have your component registered in the Wow6432Node.




回答2:


also, you probably compiled your dll with AllCPU option try to compile with x64 and/or x86 option and register like you do

  • for x64 - "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe" /register /codebase "C:\x64\o.dll"
  • for x86 - "C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" /register /codebase "C:\x86\o.dll"

P.S. its 5yo question, but may be help to other peoples



来源:https://stackoverflow.com/questions/24451812/how-to-do-regasm-so-that-it-cover-32-bit-and-64-bit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!