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've just installed VS2008 and have run into a problem that I'm sure can
I have a window service which i developed in c# (vs2008). please tell me
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
I have created a new VS2008 ASP.Net Web service project, with the default name
I have a VS2008 solution containing two projects, a web service (the actual work
I have a service which should handle documents by downloading and uploading to it.
Unable to access WCF Service from Client machine I have three projects : WCF
I have a Service Reference (not a web reference) in VS2008 to a web
I have a VS2008 C++ project which currently I compiled on VS2010. it contains

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.