Please help me build a 64bit SE addin

 

Hi all,

I've developed a 32bit addin for SE using VS2010 (VB.NET) and v3.5 of the framework. The solution contains the addin project and a deployment project. The target CPU for the addin project (in advanced compile options) is currently 'AnyCPU'.

The solution builds and works OK for X86. I now need to build a version of it that will work with 64bit SE. I've read another post on this form relating to building 64bit addins and I've looked at the readme.txt in the SE sample VB.NET addin folder, but I'm still having trouble making any sense of it all.

 

From what I can make out, I need to untick 'Register for COM interop' in the project compile page and use a 64bit version of the regasm.exe tool (delivered with v3.5 of the framework) and build the project from the command line, rather than the IDE. I assume that I then simply build the deployment project as normal and all will be OK.

Has anyone the time and patience to confirm the above and then define the steps to do this in a 'step-by-step' 'idiots' guide?

 

Thanks,

Dave

 

 

Posted by: Dave Rothan
Post date: 6/7/2011 10:37:03 PM

1 REPLY

RE: Please help me build a 64bit SE addin

 

Hi Dave,

 

you almost have it - all you have to do is:

 

- In VS2010 untick "Register for COM Interop" and instead register the addin manually (see below)

- Compile your project within the IDE with configuration "AnyCPU"

- Register the addin using a cmd.exe console window run as Administrator: 

 

For 32-bit (.NET 4.0) enter: %windir%\Microsoft.NET\Framework\v4.0.30319\regasm.exe /codebase YourAddIn.dll

For 64-bit (.NET 4.0) enter: %windir%\Microsoft.NET\Framework64\v4.0.30319\regasm.exe /codebase YourAddIn.dll 

 

You'll get a warning by regasm regarding the codebase which you can discard.

 

For .NET 3.5 or lower replace the version sub directory accordingly.

 

To unregister the addin, enter:

 

For 32-bit (.NET 4.0): %windir%\Microsoft.NET\Framework\v4.0.30319\regasm.exe /u YourAddIn.dll

For 64-bit (.NET 4.0): %windir%\Microsoft.NET\Framework64\v4.0.30319\regasm.exe /u YourAddIn.dll

 

- In order the tool regasm to be able to register your addin correctly the instructions given in the manual "Solid Edge Programmer's Guide" must be followed: 

 

Your AddIn class must be decorated by the attribute:  ComVisible(True)

A public method i.e. RegisterFunction(ByVal t As Type) must be present, decorated by the attribute: ComRegisterFunctionAttribute()

A public method i.e. UnregisterFunction(ByVal t As Type) must be present, decorated by the attribute: ComUnregisterRegisterFunctionAttribute()

 

See document m28000.pdf, page 184 ff for details.

 

 

@Jason:

 

The editor used by this forum's software is quite uncomfortable and has some strange behaviour.

 

 

Posted by: Wolfgang Kunert
Post date: 6/7/2011 11:33:37 PM