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

  • Home
  • SEARCH
  • 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 6476811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:52:17+00:00 2026-05-25T06:52:17+00:00

Not sure if the title covers the question well, but here it comes. I

  • 0

Not sure if the title covers the question well, but here it comes.

I have a project with:

  • A website: webforms (Aps.net 4,c#) where the user can upload files, interact with them and manually trigger some batch processing
  • A classlib with all the business logic for the processing
  • An app that runs on a machine at the customers location and is scheduled to upload files by SFTP to our server.
  • A console app that is scheduled on the server and does the batch processing for the files that are uploaded by SFTP.

‘heavy use customers’ use the SFTP app, the others use the website.

The console app and the website both use the same classlib.

What mechanism can I use to send logging/progress information to the website or the console app without implementing two classlibs? I do not want the classlib to be aware that it is called by the console app or the website. For example they also share the same settings. etc.

Any ideas?

  • 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-25T06:52:18+00:00Added an answer on May 25, 2026 at 6:52 am

    Events.

    You could add events to the classes that perform the actual business logic in your shared lib. When something happens that requires feedback, you can raise that event in the class.

    The consuming application (either the console app or the web-app) can subscribe to those events, and take the appropriate action that is specific to their platform.

    A very simplyfied example:

    public class SomeLogicClass
    {
       public event EventHandler SomethingDone;
    
       protected virtual void OnSomethingDone()
       {
          if( SomethingDone != null )
          {
               SomethingDone(this, EventArgs.Empty);
          }
       }
    
       public void DoSomething()
       {
           // Do some work.
           OnSomethingDone();
       }
    }
    

    In your console-app you can do this, for instance:

    var x = new SomeLogicClass();
    x.SomethingDone += (s,e) => Console.WriteLine ("Work done.");
    x.DoSomething();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not sure if my title is worded well, but whatever :) I have two
Not sure if I've worded my title correctly but here goes. I have a
I'm not sure that title is worded very well, but not sure how else
Not entirely sure my question title describes what I want to do, but couldn't
I am not sure how clear my question is by the title, but I
I am sure the title of my question doesn't make much sense. But here
Not sure what the correct title for this question should be. I have the
I'm not sure the title of question is all right, as well as how
Not sure if my title is correct. Forgot what it is code. But here
I am not sure the title of this question covers what I mean. In

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.