SolidWorks Express
 
Creating SolidWorks .NET Add-ins Using Microsoft Visual Studio on a 64-bit Machine
 
 

If you use Microsoft Visual Studio to develop .NET add-ins for SolidWorks, then you probably already know that setting the Register for COM interop property registers your .NET assembly, which makes life a lot easier for you. However, if you are running 64-bit SolidWorks on a 64-bit machine, then simply setting this property is not enough.

Both Microsoft Visual Studio 2005 and Microsoft Visual Studio 2008 internally use the 32-bit version of RegAsm.exe to register your DLL, which only populates 32-bit registry settings. Thus, when you run your 64-bit version of SolidWorks, you will not see your add-in.

Microsoft's Knowledge Base article 956933 explains how to create a post-build process for a Microsoft Visual Studio .NET add-in project to call the 64-bit version of RegAsm.exe. But, because your .NET DLL is not going to be registered in the global assembly cache (GAC), you need to include the /codebase command line argument in your post-build command line. So, if you're following Microsoft's Knowledge Base solution, then your post-build command line would be:

"%Windir%\Microsoft.NET\Framework64\v2.0.50727\regasm" /codebase "$(TargetPath)"

Solidworks can now load your .NET add-in after it compiles.

   
 

 

   
   
 
   
 
 
>> SIGN UP for SolidWorks Express Newsletter and get the tips and tricks delivered into your inbox every two weeks!