Express Edition -> cannot debug DLLs????

1167
9
08-20-2010 07:51 PM
JakubSisak
Occasional Contributor III
So seeing that VBA will eventually not be an option i decided to go with ESRI's recommendation to convert my code to VB.NET using the VS 2008 Express edition.
That's great and all but in the Express edition you cannot debug DLLs

That makes the Express edition pretty well useless... Does it mean that i will need to purchase Visual Studio?
0 Kudos
9 Replies
AndrewMay
New Contributor
What dlls are you trying to debug?  You can certainly debug your own code with Express so it's far from usless.
0 Kudos
JakubSisak
Occasional Contributor III
What dlls are you trying to debug?  You can certainly debug your own code with Express so it's far from usless.


I need to step through my code to see where exactly i am getting my error. For me this is a fundamental functionality.  (a non issue with VBA but i am re-writting my tools in VS Express since VBA will not be included in the next release of ArcGIS)
From what i found out, i cannot run an external application (ArcMap) to debug DLLs.  I would be greatfull for a solution other then VS Pro.
0 Kudos
LucasShang
New Contributor
If you are using C# 2008, here is one way to debug:

right click on your project in the "solution explorer", choose "Properties", on the popup window, find "Debug", then set "Start extenal program" with your ArcMap.exe (or ArcCatlog.exe), for Arc 10 is: C:\Program Files\ArcGIS\Desktop10.0\Bin\ArcMap.exe.

Then, you should be ready to debug from C#.
0 Kudos
JakubSisak
Occasional Contributor III
Thanks for taking your time to answer my question....
I am using VB, but C# or VB, what you describe is not an option in the express edition. (see attached)

ESRI states the DDL's cannot be debugged with the express edition: "If you are using the Visual C# Express Edition or Visual Basic Express Edition, you cannot debug DLLs because these versions do not have the option to start an external application for debugging."

Source: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//0001000001w2000000
0 Kudos
AndrewMay
New Contributor
Hi
I see what the problem is now.  There's a couple of things you could try, though I've not got a copy of VS Express on my machine to test these on.  First is to start Arc and then in VS go to Tools->Attach to process.  Select the ArcDesktop process and click Attach.  This should then allow you to debug the dll.

The other thing to try is to manually edit the vbproj file (or it might be the vbproj.user file if you've got one).  You need to add the lines in the bold below:

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <StartAction>Program</StartAction>
    <StartProgram>C:\Program Files\ArcGIS\Bin\Arcmap.exe</StartProgram>

  </PropertyGroup>

You'll probably need to do this in a few places in the file.  Then hopefully VS Express will be able to pick this up and start Arc when you start debugging.  You can also add the following line if you want to add arguments

    <StartArguments>C:\MyFolder\MyFile.mxd</StartArguments>

Hope these work for you.  There might well other (better) ways to do this though.
Regards
0 Kudos
JakubSisak
Occasional Contributor III
Thanks,
Tools->Attach to process - also not an option. I will try to manually edit the vbproj file and will report back....
0 Kudos
RichardWatson
Frequent Contributor
I have not used Visual Studio Express so I cannot comment on that.  That said, if you do not want to spend money then you can use the free WinDbg debugger from Microsoft.  It is actually more powerful than Visual Studio but it is also more primitive (command line options versus GUI).
0 Kudos
JakubSisak
Occasional Contributor III
Hi
I see what the problem is now.  There's a couple of things you could try, though I've not got a copy of VS Express on my machine to test these on.  First is to start Arc and then in VS go to Tools->Attach to process.  Select the ArcDesktop process and click Attach.  This should then allow you to debug the dll.

The other thing to try is to manually edit the vbproj file (or it might be the vbproj.user file if you've got one).  You need to add the lines in the bold below:

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <StartAction>Program</StartAction>
    <StartProgram>C:\Program Files\ArcGIS\Bin\Arcmap.exe</StartProgram>

  </PropertyGroup>

You'll probably need to do this in a few places in the file.  Then hopefully VS Express will be able to pick this up and start Arc when you start debugging.  You can also add the following line if you want to add arguments

    <StartArguments>C:\MyFolder\MyFile.mxd</StartArguments>

Hope these work for you.  There might well other (better) ways to do this though.
Regards



Thanks Doc,
editing the vbproj file works.  Insted of adding i replaced the existing lines.
I tried putting in the Start Arguments to use a specific mxd but it seems to be igored and a new "Untitled.mxd" document starts with the debugger.

Still, this is great. Thanks!
0 Kudos
EvanThoms
Occasional Contributor II
"If you are using the Visual C# Express Edition or Visual Basic Express Edition, you cannot debug DLLs because these versions do not have the option to start an external application for debugging."


That's odd, VB Studio 2008 Express? On the debug tab I selected a working directory where my mxd sits, and then put the name of the mxd in the Command line arguments windows and that's the mxd that started up when debugging started in Studio. Admittedly, the meaning of the two windows escaped me until I had gone through the trouble of manually editing the vbproj file.
0 Kudos