views:

301

answers:

4

I am working on creating a windows mobile application and I have a quick question. I have looked around for the answer and cant find anything. Is it possible to run a windows mobile application on a physical hardware device from visual studio? I don't need to be able to debug really, I just would like to be able to select my device and have it build, copy to the device, and run. Is there anyway to set this up?

+3  A: 

There is a "Device" toolbar that should let you choose your target device. Check for it under the View -> Toolbars menu (for VS 2008... not sure if you are on a different VS version).

If you are only showing emulators, you might need to install the windows mobile 6 sdk (I don't know for sure, but I do know I also have that installed... could be that this only includes the emulators as well).

Update:

It might also be worthing right clicking on your project in the solution explorer and selecting properties. From the properties page, go into the Device tab. It might be that some devices are listed there that are not listed in the target device drop down list on the toolbar. Worth a shot, but no promises.

Jason Down
I have the toolbar open but the list of devices only includes emulators. Is there a way to get visual studio to recognize your physical device?
thecaptain0220
And when you right-click on your project file it will allow you to hit Deploy and that will build and copy the app to the selected device.
tomlog
Have you got ActiveSync (pre Vista) or Windows Mobile Device Center (on Vista) installed? Is the device connected to your PC?
tomlog
Yes I am running Window 7 Professional and I have the device connected via WMDC.
thecaptain0220
Have a close look in the list. Is there any entry called 'Windows Mobile 6 Professional Device'? (or 'Windows Mobile 5.0 Pocket PC Device' if you use that). Because that's the one you should use.
tomlog
Well the drop down list doesn't contain the professional device options. If I go to device options I can however I can see the professional devices but cannot get them to appear in the drop down.
thecaptain0220
Actually I think I know why, it just dawned on me. I am trying to run the GPS sample application which probably isn't a professional project. Is there any way to run it if it is just a standard project or a way to convert it?
thecaptain0220
In solution explorer right click your smart device project and select 'change target platform'... that should give you a list of the installed platforms that you have available, choose the one for your device. If your device isnt listed then you may need to install an additional sdk
Matt
A: 

Yes. If it's like mine (Verizon Motorola Q) Visual Studio will copy several files to the device and the device will prompt you to allow them. You only have to do that part once. Then when you debug on your device you may get a prompt to allow the program you're debugging to run. It seems to copy your program over to a folder in the devices "Program Files" folder and runs it from there. And it leaves it there even after you stop debugging.

And one more thing. With Visual Studio 2005, you'll need at least the standard edition to do mobile development. With Visual Studio 2008, you'll need at least the professional edition.

Slapout
+1  A: 
fyasar
A: 

Thanks for the help everyone. My solution was a mix of a couple answers. I had to switch the project to the Windows Mobile 6 Professional SDK first and then I was able to select "Windows Mobile Professional Device"

thecaptain0220