Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 340381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:36:39+00:00 2026-05-12T10:36:39+00:00

I have a very simple windows Service that is developed in vb.net 2008. When

  • 0

I have a very simple windows Service that is developed in vb.net 2008. When I try to debug it by going to tools-> Attach to process though I see my service it is disabled and Type of Managed and I cannot select the process.

How do I debug my service?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T10:36:39+00:00Added an answer on May 12, 2026 at 10:36 am

    Attaching to the service should work, so I’m not sure why you can’t. In lieu of that, insert the following line in the application entry point for your Windows service (or the OnStart() method), compile in debug mode, and start the service.

    System.Diagnostics.Debugger.Break();
    

    When you start the service, you will be prompted to debug the process. Select the Visual Studio 2008 debugger, and the process will load and stop at your programmatic breakpoint. Hit F5 to start running again.

    EDIT:

    Let’s say that you’ve built the service (release mode or debug mode – it doesn’t matter) and used installutil to install the service, but you haven’t started it yet. As long as the service is not running, you can continue to make code changes and re-compile. When you start the service, your service will reflect your latest code changes. If the service is running, you will not be able to fully compile the service because the exe/dll(s) are in use and cannot be replaced. Obviously, simply stop the service, re-compile, and then re-start the service. The point is this: You do not have to uninstall the service in order to modify the code. Just stop it, change the code, re-compile, and re-start.

    As for debugging in debug vs. release mode, I don’t know if that’s why you can’t attach to the process. I do know that it is possible to debug release versions, but I would not recommend this simply because if optimizations are turned on, you may run into issues traversing the code. We’ve only used release-mode debugging as a last resort.

    By default, when you build a Visual Studio application in debug mode, it is put in a bin\Debug subdirectory of your project. When you build in release mode, the executable is put in a bin\Release subdirectory. When you use installutil to install your service, the only thing that matters is where the service resides. In your case, I would suggest un-installing the release-mode version of your service (installutil /u c:\myapp\myapp\bin\release\myapp.exe), putting the programmatic breakpoint in, building the debug version, and then using installutil to install the debug version (from the bin\Debug directory).

    Sorry this was long-winded. I hope that’s clear.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a Windows Service, that opens up a WCF service on port
Very simple question that I've been having trouble answering. In Windows XP and Server
I have created a very simple window service using visual studio 2010 and .NُET
I'm working with Windows Azure Table Storage and have a simple requirement: add a
We have a .NET e-commerce application with a SQL Server 2005 back-end. A new
I've been badly let-down and received an application that in certain situations is at
EDIT: It seems that the formatting of the json string is not the problem.
I am developping an intranet ASP.NET MVC2 application for a small business. The small
I am trying to setup Django with Apache under Windows. I've activated the mod_wsgi
For a while I've been using a package called gnosis-utils which provides an XML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.