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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:57:36+00:00 2026-05-26T18:57:36+00:00

I’m getting a bit confused because I’m retrieving information which I can’t relate to

  • 0

I’m getting a bit confused because I’m retrieving information which I can’t relate to my situation.

Briefly, I have created a new WCF service application in my VS2008 (.NET 3.5sp1). In the project I have the Service.svc file (plus service.svc.cs), the IService.cs and finally the web.config file.
I’ve written my methods and I’ve modified the web.config file as needed to obtain a REST service, and all is working. But now I need to setup the logger object (specifically, the log4net object), and I started wondering about the right place to do the initialization.

Here come the things I do not understand. Searching the internet for information, I found many articles talking of application file (as the global.asax), or doing initialization where the ServiceHost object is created, in a Main method.

I do not have such files in my solution, hence my confusion arises. Have I created the wrong type of project? Or is it just sufficient to add a global.asax file? And what is the right place to do such operations (initializations…)?

  • 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-26T18:57:37+00:00Added an answer on May 26, 2026 at 6:57 pm

    You can add the global.ascx / global.ascx.cs files into a WCF project by right clicking the project, selecting add file then select “Global Application Class”.

    The ‘right place’ for the initialisation depends on how and what kind of logging you want to do. If you only have one logger and aren’t logging based on endpoint, etc, then there is no harm in initialising it statically somewhere within your application (i.e. a static constructor). And then using this logger from everywhere within the application (just don’t expose the set method).

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
I have a text area in my form which accepts all possible characters from
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into

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.