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 3234480
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:23:46+00:00 2026-05-17T17:23:46+00:00

In C# VS2008 I have a service which can run from command line and

  • 0

In C# VS2008 I have a service which can run from command line and as registered service.
I am trying to debug my Service process I wondered why it does not write logs in event viewer.
I have a logger as this:

public static void Log(string s, EventLogEntryType et) {
        try {
            if (CService.asService) {
                if (!EventLog.SourceExists("Jobs")) {
                    EventLog.CreateEventSource("Jobs", "JobsServiceLog");
                }
                EventLog.WriteEntry("Jobs", s,
                    et, 234);
            }
            else {
                Console.WriteLine(s);
            }
        }
        catch { }
    }

Then somewhere I am logging:
Log(“Jobs service started”, EventLogEntryType.Information);

Nothing is appear in the Event Viewer->JobsServiceLog.

What can be reason?

thanks

Arman.

  • 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-17T17:23:47+00:00Added an answer on May 17, 2026 at 5:23 pm

    What’s up with CService.asService? are you sure the source gets created?

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

Sidebar

Related Questions

I have a window service which i developed in c# (vs2008). please tell me
I have a Service Reference (not a web reference) in VS2008 to a web
In VS2008 I have written a C# service, an installer, and have created a
Does VS2008 have somewhat C++0x standard support? DUPLICATE Visual Studio support for new C
Aloha I have a VS2008 solution to which I want to add a webservice
I have a Windows service that is written in C++ using VS2008. I now
I have the VS2005 standard edition and MS says this: Note: The Windows Service
I have a VS2005 project that contains a couple web service references. The project
I have created a C# service using the VS2005 template. It works fine however
I have a WPF application in VS 2008 with some web service references. For

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.