Is it possible to debug an ArcGIS Mobile Task in Visual Studio

2810
11
02-01-2011 03:04 AM
NilsRydh
New Contributor
I have created an ArcGIS Mobile application for Windows Mobile 6 using only the Esri.ArcGIS.Mobile assembly. Debugging works fine in Visual Studio.

When I try to develop my own Task using the Esri.ArcGIS.Mobile.Client assembly, the project output is a dll and should be added to a project in the project center or in the .ame file.

Now, my question is: Is it possible to use debugging in Visual Studio when developing a task for Windows Mobile 6?
0 Kudos
11 Replies
AkhilParujanwala
New Contributor III
Hi, Are you using the out of the box solution for Windows Mobile? If you are, and you are making your own DLLs, then the quick answer is No, you can't debug them. Instead I put a Message box everywhere to determine the variables' value.

If I see that something doesn't make sense, then I fix it, or I use Try and Catch and when the error occurs usually the first 3 lines of the error are enough to help figure out the problem. If not more testing with the Messageboxes.


If you created your own Windows Mobile application and you are creating your own tasks, well you should just include the code in the form or class, meaning you can debug it. I am not sure why you would make it it's own dll, since you can't debug a dll.

Well from my understanding I have yet to figure out a way to debug a DLLs (task) that I use with my out of the box solution for Windows Tablets.
0 Kudos
NilsRydh
New Contributor
Hi Akhil
I am using the out-of-the-box solution for ArcGIS Mobile, and I'm trying to extend it with a new Task to create a customized data collection workflow. My users think that the standard "Collect Features" task has too many steps.

A colleague showed me how to debug the task. This is what I did:
1. I followed the Esri sample of howto develop a Custom collect features task
2. I then set the device output folder for the class library containing the task to %CSIDL_PROGRAM_FILES%\ArcGIS Mobile\10 in Visual Studio
3. In Debug settings for the same class library, I set "Start action" to "start external program" and set the path to %CSIDL_PROGRAM_FILES%\ArcGIS Mobile\10\ArcGISMobile.exe.



4. In the Build menu I set the Configuration manager to deploy the project every time it has been built.
5. Press F5 and now I can debug it in an emulator or mobile device, just like any other program.

I guess it's more or less the standard way of debugging any Windows program, but I couldn't find any description of how to do it for ArcGIS Mobile.
0 Kudos
HarshitaGupta1
New Contributor II

Hi,

I have built a ArcGIS Mobile Project with 10.2.1.I have used mobile Project Centre to prepare the map and add the custom tasks and extensions. Now I connect with the emulator and run the project. can we debug the project(tasks and extensions) in emulator (windows mobile 6 Professional)?? 

0 Kudos
AkhilParujanwala
New Contributor III
Very interesting, I am using the Windows Tablet version of the out-of-the-box solution, I am not able to replicate this., I am having trouble with the following steps.

2) This is to output the DLL file in the correct spot, so this make sense.
3) I did this and now ArcGIS Mobile 10 (Windows Tablet) will run.
4) I don't how to set the Configuration manager, well this is a Windows Mobile thing.
5) Well it launches ArcGIS Mobile 10, but I can't debug it like any other program. I even put break points for my version of a simple data collection extension and the application just ignored my breakpoints and continued as if I wasn't debugging.

Do you mind trying to figure out this can work with the Window PC/Tablet verision, because right nwo I use a lot of message boxes, which is fine, but debugging would be so much faster.

Thanks in advance,

Akhil P.
0 Kudos
NilsRydh
New Contributor
It should work for the tablet version as well.

4) The Configuration manager is available for all Visual Studio projects. It is in the build menu, select the deploy checkbox.





5) The last build of the dll has to be available for the debugging to work. If you set the project to deploy at every build it should work. You can also deploy the project manually by right-clicking the project and selecting deploy:

0 Kudos
AkhilParujanwala
New Contributor III
Thanks for trying to help, I just noticed you are using VS 2010, I am using 2008, and I still don't see a Configuration Manager, nor do I see the option to manually Deploy when I right click, I see build and clean.

Also I am making extensions, not tasks, maybe that makes a difference?
0 Kudos
NilsRydh
New Contributor
I am using VS 2008 SP1, and it should work with any class library.
Maybe you don't have the deploy option, in a non-mobile project. Then you need to figure out the correct path for the build output. I'm not sure where a project extension should be placed. Probably [ArcGIS Installation]\Mobile10.0\bin.
0 Kudos
AkhilParujanwala
New Contributor III
Hmm, your right about the location of where the DLL goes, the bin folder.

You mind quickly making a simple extension and testing if you debug like you can normally do with a regular program made in VS please.


Thanks,


Akhil P.
0 Kudos
AkhilParujanwala
New Contributor III
Bump, I am still curious on how to debug in VS 2008.

I am using ArcGIS Mobile 10, out of the box solution for Windows Tablet. I am working on Extensions. Can please get detailed instructions on how to debug in VS 2008.

(I know this may be a simple solution but I just can't figure it out)

Thanks,

Akhil P.
0 Kudos