Debugging in VB.NET Express 2005 & 2008

Debugging in VB.NET Express 2005 & 2008

Anonymous
Not applicable
1,373 Views
2 Replies
Message 1 of 3

Debugging in VB.NET Express 2005 & 2008

Anonymous
Not applicable
XP 32bit
Inventor 2010

Brian Ekins in his paper on going from VBA to VB.NET notes how one can add a file to the project folder in VB.net Express and enable the capacity to debug AddIns. Does this need/how does this need to change if I am running Inventor 2010? The file text is as follows:

I tried to post the text, but with the XML tags in the text, it will not format here properly. I did use the formatting suggestion in this forum, but it didn't work.

Does it work for VB.net Express 2005/2008 and are any changes required for said versions?

Also, does this information change to accomodate Windows Vista - 64bit?

Any help is much needed and will be greatly appreciated!!
0 Likes
1,374 Views
2 Replies
Replies (2)
Message 2 of 3

-niels-
Mentor
Mentor
I did this for my project, if i remember correctly i edited a file that was already present.
I've attached the file as a zip.
I'm also on 2010 on xp32, so don't know about vista 64.

Niels van der Veer
Inventor professional user & 3DS Max enthusiast
Vault professional user/manager
The Netherlands

0 Likes
Message 3 of 3

Anonymous
Not applicable
Hi...

Maybe I can give you some helpfull information on this one:

To be able to debug a Visual Basic project inside an application you have to tell which program needs to be started up when the debug is starting. In Visual Studio this is a setting in the project properties. In Visual Basic Express you can set this setting in the [projectname].vbproj.user file.

So, look inside your Visual Basic project folder for this file. Open it and replace everything with:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <StartAction>Program</StartAction> <StartProgram>C:\Program Files\Autodesk\Inventor 2010\Bin\Inventor.exe</StartProgram> </PropertyGroup> <PropertyGroup> <ProjectView>ShowAllFiles</ProjectView> </PropertyGroup> </Project>

The bold text above is telling the program location.

To debug a 64 bit add-in you first need to register the add-in in the correct section of the registry of Windows. Otherwise Inventor will not show (and load) your add-in.

To do this you should create 2 batch files (see below here).

1) RegisterInventorAddin.bat



C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe "C:\Temp\Example\InventorAddIn.dll" /codebase



PAUSE

2) UnRegisterInventorAddIn.bat

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /u "C:\Temp\Example\InventorAddIn.dll"



PAUSE


Before you start debugging you need to rebuild your project --> Run the RegisterInventorAddIn.bat batch file --> Start debugging

Then evertything should work correctly!!

Pain in the *** though is you cannot change any code while debugging a 64-bit application. You have to stop debugging everytime, make your changes and start debugging again. With the full version of Visual Studio you can attach your add-in to a running Inventor process. By using this on 64-bit applications you can leave Inventor running and just stop debugging your program, make some changes, attach it again to the already running Inventor process. This is going much faster then using Visual Basic Express, because start debugging will need to startup Inventor everytime.

So, my advise is building a Virtual PC with for example Windows XP 32-bits, MS Office, Inventor, Visual Basic Express installed. Use this Virtual PC as your development environment. After your program is tested and everything works as you want, you simply register the dll on your 64-bit system (by using the batch files) and then you can use your add-in.

Hope this helps!

Kind regards,

Pim Saarloos

Edited by: psaarloos on Sep 21, 2009 12:23 PM Edited by: psaarloos on Sep 21, 2009 12:31 PM
0 Likes