Solidworks 2009 x64 + VS2008 Not connected

Hi!

I'm not a super programmers but I do couple of little addins to simplified my life... I've upgrade to XPx64. Now all my code and new from vs2008 are not connecting to Solidworks any clue?

thanks

SolidworksApi macros
Answers 27
AZ
AZ 2009-07-22 Best Answer

Hi,

you have to use the x64 version of regasm instead of the x86 version of regasm which is used by default when you build your solution within VS2008.

Alex

SF
SF 2009-07-22
Where do I change the regasm?
AZ
AZ 2009-07-22

Right click your VS project, select "Properties", then the "Build Events" Tab and go to the "Post-build event command line:" and insert this:

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

Then go to the "Build" tab and uncheck "Register for COM interop".

Alex

SF
SF 2009-07-22
So I will need to purchase the Full version I believe I've reach the limit of the express edition... I don't have those option!
AZ
AZ 2009-07-22

You could try to run regasm from the command line - this should always work.

Alex

SF
SF 2009-07-22
Well i'm not sure with this one, you mean from Windows "DOS" like command line?
AZ
AZ 2009-07-22

Yes, "DOS" command line.

Make sure you have the x64 version of the .NET Framework SDK 2.0 installed - if it is installed, you should have a folder C:\Windows\Microsoft.NET\Framework64\v2.0.50727

There you should find the regasm.exe

Alex

SF
SF 2009-07-22

Ok, I got folder and everything...

C:\Documents and Settings\Simon\My Documents\Visual Studio 2008\Projects\SP Solution Toolbox\SP Solution Toolbox\SP Solution Toolbox.vbproj

What should the command line look?

I've try regasm C:\Documents and Settings\Simon\My Documents\Visual Studio 2008\Projects\SP Solution Toolbox\SP Solution Toolbox\SP Solution Toolbox.vbproj /registered

It return : Regasm : error RA0000 : unable to locate input...

AZ
AZ 2009-07-22

In the command line window navigate to the folder

C:\Documents and Settings\Simon\My Documents\Visual Studio 2008\Projects\SP Solution Toolbox\SP Solution Toolbox\bin\Debug

Call (use the full path, in order to make sure that the x64 version of RegAsm is called)

C:\Winodws\Microsoft.NET\Framework64\v2.0.50727\RegAsm.exe NameOfYour.dll

Alex

AZ
AZ 2009-07-22

As I'm always inquisitive I installed the VS 2008 express edition - you can set Build properties and Build Events as you can do in VS 2008 full editions:

Build Properties:

Build Events:

Alex

comment imagecomment imagecomment imagecomment image
IK
IK 2009-07-22
Is your program written in C# or VB? Build events are only in C#
SF
SF 2009-07-22
I don't have this in VB express you're doing C# not VB!
IK
IK 2009-07-23

in dos window

cd C:\Winodws\Microsoft.NET\Framework64\v2.0.50727

regasm fulpath\your.dll

regasm fulpath\your.dll /tbl

regasm fulpath\your.dll /codebase

you can also drag and drop your dll from explorer to dos window - it is simpler than type full path and name.

or buy this book http://angelsix.com/products/

SF
SF 2009-07-23
You solve my problem half... I can't debug using this technic, I need to build-it i386 then convert-it x64!
AZ
AZ 2009-07-23

Try building it for x64 - Tools / Options => Check "Show all Settings" at the bottom line of this window

Then in Tools / Options / Projects and Solutions / Check "Show advanced build configurations"

Then in Build / Configuration Manager / Active Solution Plattform / New

Select x64 from "New platform" / Copy Settings from "Any CPU"

Use this setting for your Build.

After you've build => re-run regasm.exe

Debugging won't be able this way as express edition does not allow to connect to a running process.

Alex

SF
SF 2009-07-23

Final Word I think, will need to get a pro-version... express is a toy where you dig your hand in and get eatten by the need

Thanks

SF
SF 2009-07-23

Simon,

No need for pro if you just want to debug a dll in VB Express. Simply send the Build property screen to the second option to run an external program after build and browse for SLDWORKS.exe

AZ
AZ 2009-07-24

But then he won't be able to run regasm x64 post build?

Alex

SF
SF 2009-07-24
why would he need to after the first time? Regasm only needs to be run once unless you are changing the location, name, or GUID?
AZ
AZ 2009-07-24

Thought regasm needs to run after every build - my mistake.

Alex

SF
SF 2009-07-24
Nope regasm just adds the correct file references to the registry and CLSID entries, and a few other things, but they all work on the file location, name, and GUID so no need to re-run if they don't change.
SF
SF 2009-07-24

Now, to get a final answer and win the 1000000$ JackPot, does the Full VS2008 Std/Pro will allow me to debug on x64.

Thanks All

AZ
AZ 2009-07-24

Yes, it does.

Alex

SF
SF 2009-07-24
So if I don't need extra web stuff like Ajax... the Standard version should be the pick... Right?
AZ
AZ 2009-07-24

Yes, Standard Edition should work for you.

To make sure you get what you need, take a look at this detailed product comparision sheet:

http://www.microsoft.com/downloads/details.aspx?FamilyID=727BCFB0-B575-47AB-9FD8-4EE067BB3A37&displaylang=en

Alex

SF
SF 2009-07-29

Simon,

If I am not mistaken Express can debug in x64 bit what is the problem? Just set the Startup external program to SLDWorks.exe. All be it I have not been using express for a while but sure you have that facility.

SF
SF 2011-07-26

.................2 years later.

Alex,

I coudn't get my add-in to work until I added \codebase to your suggestion in the post-build event

Your suggestion:

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

What worked for me:

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

I know we talk about \codebase lower in this discussion but in the context of the command window, not the post-build event.

Just thought I would share and hopefully help someone with the same problem.

Cheers.

P.S. The opening and closing quotes are part of the code to copy-paste.