Last few months I and my teammates are working with several service base applications. In last project I had faced great deal of problem with service. That was my first windows service application. That time I realized that windows service application does not allow debugging as normal application. That project I was using log file to debug the win service application. I have not enough time to find out that problem solution. Later I find a solution how to debug a win service application as like normal application (but not quite similar).
A windows service was a little different than normal debugging of an application. Here we’ll look into how you can debug your windows service.
First, open Visual Studio and load your win service application, if it’s not already there. Assuming your build was successful; you can now install and test your windows service. There are two ways to install, we can use the installutil.exe, or create a full blown MSI installer.
We’ll need to open a Visual Studio Command Window. Start, All Programs, Microsoft Visual Studio 2005, Visual Studio Tools, Visual Studio Command Window. If you are running under Vista, STOP! Do NOT click on Visual Studio Command Window. Instead, right click and pick “Run as Administrator”. Again that’s for Vista, for XP just click since you likely have Admin rights.
Now in the command window navigate to the bin\debug folder where your project compiled.
Now comes the neat part. Under the Debug menu in Visual Studio, select “Attach to process…” When the dialog below appears, you will need to check the “Show processes from all users” and “Show processes in all sessions” boxes. Now your list should update correctly.

Scroll down and look for the process with the same name as your executable, in my case it was TimeLogger.exe. Click on it and the click the “Attach” button in the lower left.
If all went well Visual Studio should shift to “Run” mode. Your code will be locked (sorry, no edit continue with windows services). But you can go in and create breakpoints.
Now sit back and wait a minute, when our service fired (Use service Manager for start or stop service). It will fall into the standard debug mode you’re used to, as you can see below.
When you are done debugging and are ready to disconnect from the service, simply return to the Debug menu and this time pick “Stop Debugging” (or hit Shift+F5). Visual Studio disconnects you from the running service and returns you to normal code editing mode.
Resetting for another test is still a bit painful. You’ll want to stop your service, then in your Visual Studio Command Prompt window run InstallUtil, this time with the /u option to uninstall it. (instalutil /u timelogger.exe). Then you can build, and then reinstall your service.
Reference
http://arcanecode.wordpress.com/
Normal
0
false
false
false
MicrosoftInternetExplorer4
What is WPF?
The Windows Presentation
Foundation (or WPF), formerly code-named Avalon, is a
graphical subsystem in .NET Framework 3.0. WPF is an API for building
graphical user interfaces (UI) for desktop applications with the .NET
Framework.
Physically, it's a set of .NET
assemblies and supporting tools. It's intended to provide a unified API for
creating rich, sophisticated user interfaces on Windows XP and Windows Vista.
WPF is just one part of a larger
picture. Three additional libraries were also released as part of .NET 3.0. All
four of these libraries have the same intent of providing a consistent, unified
API for their domain. Additionally, combining any of these four libraries in an
application can yield some very impressive results.
The three sibling libraries of
WPF are WCF, WF and CardSpace. I will discuss about those later post.
The immediate predecessor to WPF
is Windows Forms, the graphical API available to developers in .NET 2.0 and
earlier. Windows Forms provides a managed wrapper for accessing the graphical
functions of the traditional Windows API. WPF differs fundamentally in that it
builds on top of DirectX. The DirectX API was originally focused on multimedia
and game programming in particular. As such, you are able to do some nifty
visual tricks in WPF that were practically impossible with Windows Forms. It
also means that WPF will take advantage of hardware acceleration when it is
available.
See demo WPF application in below link under Sample.
References
Sample