
How to Compile a SolidWorks x32 VB.NET Add-in for SolidWorks x64

Solution
ID: |
S-011583 |
| Applies to: |
SolidWorks |
| Version: |
1.0 |
Category:
|
Add-ins, SolidWorks API, SolidWorks x64, VB.NET
|
Created: |
01-15-2008 |
Last
revised: |
01-15-2008 |

To use a SolidWorks VB .NET add-in developed for a 32-bit machine with SolidWorks x64, you must recompile the add-in with Microsoft Visual Studio 2005 Professional Edition or later.
Selecting Any CPU for Active solution platform in the Configuration Manager should be all that you have to change to compile for SolidWorks x64. You do not have to replace the references to .NET Framework assemblies (e.g. System.Data) with their x64 equivalents; the .NET runtime determines at runtime which version of these assemblies to load.
Once compiled, register the add-in with COM and SolidWorks x64 using the RegAsm.exe tool with the /codebase option so that SolidWorks x64 can find the add-in. If the add-in does not show up in SolidWorks Tools, Add-ins, load the add-in using File, Open.
In essence, the process of registration is identical to that on Windows x32. However, on Windows x64 there are two views on the registry:
- 64-bit view, which is the real view
- 32-bit view, which is represented by a set of special keys in the 64-bit view all named Wow6432Node
A 64-bit application reads from and writes to the 64-bit registry view; a 32-bit application reads from and writes to the 32-bit registry view.
Because SolidWorks x64 is a native 64-bit application, SolidWorks looks for add-ins in the 64-bit registry view. To ensure that your add-in registration data ends up in the 64-bit registry view, use the 64-bit version of the RegAsm.exe tool, which you can find in C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727.
When installing an add-in using Windows Installer, consult the Windows Installer user guide for information about setting the target registry view for a registry entry. 




|