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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:03:07+00:00 2026-05-25T23:03:07+00:00

I am working on a .Net project(solution) which is having 25 projects. I want

  • 0

I am working on a .Net project(solution) which is having 25 projects. I want to set the value in some function/method so that It can be set once for the entire application. Where to set this method so that I dnt need to set it again in the individual winforms. That function/method is in some dll so i required to set that like this:

Logger obj = Logger.GetInstance();
obj.SetLogLevel(1);

I need to use the above code only once.

Kindly help?

Thank You…

  • 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-25T23:03:08+00:00Added an answer on May 25, 2026 at 11:03 pm

    Since you talk about pages, I assume you have a web site or a web application.
    What you can do, in this case is to create a static class in App_Code and do this in it’s static constructor. This way the first time any page accesses the static class the code will run and it won’t run again.

    public static class AStaticClass {
    
        public static Logger Obj;
    
        static AStaticClass() {
            Obj = Logger.GetInstance();
            Obj.SetLogLevel(1);
        }
    }
    

    EDIT:
    In case this is a window application, just put this static class in one of the libraries. It doesn’t really matter where the class is.

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

Sidebar

Related Questions

I am working on a .NET project, which needs to interact with some user
I'm working on a asp.net mvc3 solution that has 3 projects Data, Service, and
I'm currently working on an C#/ASP.NET project that will host several differents e-commerce websites,
I'm working on an ASP.NET project for a school. In one area I want
I am working on an asp .net net project which calls a workflow service.
I'm working on a solution where I have a WPF project that is using
My team is working with a .NET 2008 DB Project in their solution so
I'm currently working on .Net projects that are using either Git or Mercurial (Hg)
I'm working on a Website Project (as opposed to an ASP.NET Web Application) which
I'm working on a VS2010 Solution containing an ASP.NET Website Project and 8 c#

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.