PC Review


Reply
Thread Tools Rate Thread

debugging CF with full framework (e.g. without the emulator) ! and ?

 
 
Yechezkal Gutfreund
Guest
Posts: n/a
 
      11th Nov 2003
I am probably not the first that has found that for many applications, one
does not need the emulator to run CF executables. There are a few
wierdnesses
about the interface when one "links" to the full framework, but other than
that the speed for testing out logic errors versus launching the emulator or
doing a real load via activesync to the PPC is a win in my case.

Please excuse the novice nature of this question:
Here is my question:

I would like to use the VS debugger (e.g. debug->start new instance) to run
this CF project. But the project is targeted for the emulator or for the
real PPC.
Is there a way to temporarily set the project (without jepordizing the code,
or
doing any later rewrites or mods to go back to the PPC version) to run off
of
the full framework?

Specifically, I have a solution with two projects. A Full framework server
component
and a PPC client project. If I start the debugger for the full solution, it
spawns
the server application locally, and the client application remotely (or in
the emulator).

I would like to do a quick VS only mod of the project to make both come up
locally
on the development box, so I can use the local debugger.

Or, is there a way to attach to the local processes instance (that I create
when
I locally run the ppc.exe) and have the breakpoints in the ppc.exe trigger
the VS debugger.



 
Reply With Quote
 
 
 
 
Yechezkal Gutfreund
Guest
Posts: n/a
 
      11th Nov 2003
Basically, I am hoping for something simple. Like to use the Configuration
Manager to change
the platform from PocketPC to .NET (but the drop down does not give me that
option!).


"Yechezkal Gutfreund" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I am probably not the first that has found that for many applications, one
> does not need the emulator to run CF executables. There are a few
> wierdnesses
> about the interface when one "links" to the full framework, but other than
> that the speed for testing out logic errors versus launching the emulator

or
> doing a real load via activesync to the PPC is a win in my case.
>
> Please excuse the novice nature of this question:
> Here is my question:
>
> I would like to use the VS debugger (e.g. debug->start new instance) to

run
> this CF project. But the project is targeted for the emulator or for the
> real PPC.
> Is there a way to temporarily set the project (without jepordizing the

code,
> or
> doing any later rewrites or mods to go back to the PPC version) to run off
> of
> the full framework?
>
> Specifically, I have a solution with two projects. A Full framework server
> component
> and a PPC client project. If I start the debugger for the full solution,

it
> spawns
> the server application locally, and the client application remotely (or in
> the emulator).
>
> I would like to do a quick VS only mod of the project to make both come up
> locally
> on the development box, so I can use the local debugger.
>
> Or, is there a way to attach to the local processes instance (that I

create
> when
> I locally run the ppc.exe) and have the breakpoints in the ppc.exe trigger
> the VS debugger.
>
>
>



 
Reply With Quote
 
Alex Feinman [MVP]
Guest
Posts: n/a
 
      11th Nov 2003
You cannot change the project type, but there is an alternative. When I was debugging a cross-platform CF application, I wrote a simple macro:

Imports EnvDTE
Imports System.Diagnostics
Imports VSLangProj
Imports Microsoft.VisualStudio.VCProjectEngine
Imports Microsoft.VisualStudio.VCProject
Imports System

Public Module Tools

Sub LaunchCEAppInDebugger()
Dim oProj As Project
Dim oCfg As EnvDTE.Configuration
oProj = DTE.ActiveSolutionProjects(0)
Dim vsProj As VSProject
oCfg = oProj.ConfigurationManager.ActiveConfiguration
For Each grp As OutputGroup In oCfg.OutputGroups
If grp.CanonicalName = "Built" Then
Dim filePath As String = grp.FileURLs(0)
filePath = filePath.Replace("\obj\", "\bin\")
Dim uri As Uri = New Uri(filePath)
Dim psi As New ProcessStartInfo(uri.LocalPath)
psi.WorkingDirectory = System.IO.Path.GetDirectoryName(uri.LocalPath)
System.IO.Directory.SetCurrentDirectory(psi.WorkingDirectory)
Dim pr As System.Diagnostics.Process = System.Diagnostics.Process.Start(psi)
pr.WaitForInputIdle(10000)
For Each lp As EnvDTE.Process In DTE.Debugger.LocalProcesses
If lp.ProcessID = pr.Id Then
lp.Attach()
Exit For
End If
Next
End If
Next
vsProj = oProj.Object
End Sub

End Module

1) Hit Alt-F11 to open Macro IDE.
2) Add a new module and paste this macro into it.
3) Close the Macro IDE
4) Right-click on the VS toolbar, select customize, go to Commands tab and scroll down to Macros. On the right side find your new macro and drag it onto toolbar.

At this point you can start your CF app on the desktop in debugger by simply clicking one toolbar button. In my experience sometimes for an unknown reason the debugger fails to attach. In that case simply close the application and try again

Alex Feinman

"Yechezkal Gutfreund" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> I am probably not the first that has found that for many applications, one
> does not need the emulator to run CF executables. There are a few
> wierdnesses
> about the interface when one "links" to the full framework, but other than
> that the speed for testing out logic errors versus launching the emulator or
> doing a real load via activesync to the PPC is a win in my case.
>
> Please excuse the novice nature of this question:
> Here is my question:
>
> I would like to use the VS debugger (e.g. debug->start new instance) to run
> this CF project. But the project is targeted for the emulator or for the
> real PPC.
> Is there a way to temporarily set the project (without jepordizing the code,
> or
> doing any later rewrites or mods to go back to the PPC version) to run off
> of
> the full framework?
>
> Specifically, I have a solution with two projects. A Full framework server
> component
> and a PPC client project. If I start the debugger for the full solution, it
> spawns
> the server application locally, and the client application remotely (or in
> the emulator).
>
> I would like to do a quick VS only mod of the project to make both come up
> locally
> on the development box, so I can use the local debugger.
>
> Or, is there a way to attach to the local processes instance (that I create
> when
> I locally run the ppc.exe) and have the breakpoints in the ppc.exe trigger
> the VS debugger.
>
>
>

 
Reply With Quote
 
Yechezkal Gutfreund
Guest
Posts: n/a
 
      11th Nov 2003
This is perfect, Alex. It does exactly what I want it to do. I can even start debugging on both the client and the server.

Thanks a million!


"Alex Feinman [MVP]" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
You cannot change the project type, but there is an alternative. When I was debugging a cross-platform CF application, I wrote a simple macro:

Imports EnvDTE
Imports System.Diagnostics
Imports VSLangProj
Imports Microsoft.VisualStudio.VCProjectEngine
Imports Microsoft.VisualStudio.VCProject
Imports System

Public Module Tools

Sub LaunchCEAppInDebugger()
Dim oProj As Project
Dim oCfg As EnvDTE.Configuration
oProj = DTE.ActiveSolutionProjects(0)
Dim vsProj As VSProject
oCfg = oProj.ConfigurationManager.ActiveConfiguration
For Each grp As OutputGroup In oCfg.OutputGroups
If grp.CanonicalName = "Built" Then
Dim filePath As String = grp.FileURLs(0)
filePath = filePath.Replace("\obj\", "\bin\")
Dim uri As Uri = New Uri(filePath)
Dim psi As New ProcessStartInfo(uri.LocalPath)
psi.WorkingDirectory = System.IO.Path.GetDirectoryName(uri.LocalPath)
System.IO.Directory.SetCurrentDirectory(psi.WorkingDirectory)
Dim pr As System.Diagnostics.Process = System.Diagnostics.Process.Start(psi)
pr.WaitForInputIdle(10000)
For Each lp As EnvDTE.Process In DTE.Debugger.LocalProcesses
If lp.ProcessID = pr.Id Then
lp.Attach()
Exit For
End If
Next
End If
Next
vsProj = oProj.Object
End Sub

End Module

1) Hit Alt-F11 to open Macro IDE.
2) Add a new module and paste this macro into it.
3) Close the Macro IDE
4) Right-click on the VS toolbar, select customize, go to Commands tab and scroll down to Macros. On the right side find your new macro and drag it onto toolbar.

At this point you can start your CF app on the desktop in debugger by simply clicking one toolbar button. In my experience sometimes for an unknown reason the debugger fails to attach. In that case simply close the application and try again

Alex Feinman

"Yechezkal Gutfreund" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> I am probably not the first that has found that for many applications, one
> does not need the emulator to run CF executables. There are a few
> wierdnesses
> about the interface when one "links" to the full framework, but other than
> that the speed for testing out logic errors versus launching the emulator or
> doing a real load via activesync to the PPC is a win in my case.
>
> Please excuse the novice nature of this question:
> Here is my question:
>
> I would like to use the VS debugger (e.g. debug->start new instance) to run
> this CF project. But the project is targeted for the emulator or for the
> real PPC.
> Is there a way to temporarily set the project (without jepordizing the code,
> or
> doing any later rewrites or mods to go back to the PPC version) to run off
> of
> the full framework?
>
> Specifically, I have a solution with two projects. A Full framework server
> component
> and a PPC client project. If I start the debugger for the full solution, it
> spawns
> the server application locally, and the client application remotely (or in
> the emulator).
>
> I would like to do a quick VS only mod of the project to make both come up
> locally
> on the development box, so I can use the local debugger.
>
> Or, is there a way to attach to the local processes instance (that I create
> when
> I locally run the ppc.exe) and have the breakpoints in the ppc.exe trigger
> the VS debugger.
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
updating the vs.net 2003 emulator with compact framework sp3 (yes,the emulator) Tim Wilson Microsoft Dot NET Compact Framework 1 10th Sep 2005 05:41 PM
Emulator debugging Paul Ilacqua Microsoft Dot NET Compact Framework 2 26th Jan 2005 11:52 PM
PPC Emulator Debugging =?Utf-8?B?Q29s?= Microsoft Dot NET Compact Framework 3 28th Dec 2004 09:47 AM
Emulator - Debugging etc.. garfitz Microsoft Dot NET Compact Framework 1 13th Aug 2003 11:42 PM
simple TCP socket connect (emulator - framework FAIL); framework - framework - Works [Help will be compensated] Yechezkal Gutfreund Microsoft Dot NET Compact Framework 0 16th Jul 2003 06:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:46 PM.