Need to make 32bit addin 64bit compatible, where is this option?

Ive read on other threads to set Compile to "Any CPU".  I dont see this option in the Compile Tab in Visual Studio Express 2008.

Do I need to install another version of VS Express?


BTW, I am creating this addin on a 32bit machine.  We just purchased (1) 64bit machine for testing.  I would like to have 1 addin work on any machine if possible.

SolidworksApi macros
Answers 10
SF
SF 2010-10-06 Best Answer

This "switch" is not enable in the Express Edition, but you can add it manually to the

.project file.

Open your Project file and add

x64

before

Now yor Addin is x64 ready.

But don't forget to add it with the x64 Regasm to Registry

If you want't to use it on both machines, you need to copy your project file and

make one with x64 flag and one with x86 flag.

Now open the x86 project file and compile it, then close the project, copy out your binary, open the x64 Project file and compile it again.

CM
CM 2010-10-06

I dont have a .project file, only a .vbproj file.  When I open that, I do not see a x64  line.

JC
JC 2010-10-06

look for<Platform Condition=... Platform>

and change to

<Platform Condition=" '$(Platform)' == '' ">AnyCPUPlatform>

CM
CM 2010-10-06

Actually, its already set to AnyCPU.


Any ideas why it wont work in 64bit SolidWorks?

SF
SF 2010-10-06

Chris,

Can you do a File -> Open and change the file type to .dll and load the add-in that way?

CM
CM 2010-10-07

The add-in is working now.  Maybe this will help someone else that runs into a similar situation.

So it turns out the addin was already compiled for "AnyCPU".  The issue was registering it from a network location.  By default, VB.NET only trust local assemblies.  My add-in is stored on the network so all users can use the same file, which allows me to easily update it.  I copied the add-in to my desktop and was able to register the add-in successfully.  This is a new computer, the security settings must be configured differently than our previoius computers which runs the add-in off the network.

JC
JC 2010-10-07

storing an Add-in or an marco on a network drive dose not make it easy to update

if an user is running SW with the add-in loaded or marco that has ran you can't update it the files will be locked

you would have to have all the user close down SW to do an update

the besst thing to de is a have a setup program that copy to file to the user hard drive and have an update program that will update the users dll file when ever there is a change

I gone through alot of way to update the add-in

i now have a program that called on the windows logon script that check the user version with the lastest version and update if there a newer version

this way all user will get a lasted version when the logon to there computer all so I can have them run the update if i had  a major update that then need right a way

CM
CM 2010-10-07

Ive never had any issues dealing with a locked file.  I simply wait until everyone goes home and replace the .dll file.  The next morning, everyone loads SolidWorks with the updated add-in.  Much easier than dealing with installation files and having everyone run them.  Now we have a fairly small eng dept, I guess the other route would be best for large depts.

JC
JC 2010-10-07

we have a good size group

alot of people do not close down SolidWorks when then leave so that was my problem

but if it a small group  where you could ask them to close down to update that is a good way to do it

SF
SF 2010-10-16

A good way to get around the locking issue (well not good, but quick and easy for most if they are concerned) is to have a generic add-in host that on start-up loads the dll into a stream, then spins up a new instance of it in a new application domain and loads it. That dll is you actual dll you update and would only be locked if someone was at that point in time actually starting up SW.

Luke Malpass

AngelSix (SolidWorks Tutorials and Books)

BatchProcess