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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:37:08+00:00 2026-06-01T19:37:08+00:00

I have a winforms applications which is reading strings using sockets and the sockets

  • 0

I have a winforms applications which is reading strings using sockets and the sockets are under backgroundWorker thread.

Things are working fine, but as per the new company standards my manager wants it to be run as service rather putting this winforms application in the startup folder always.

The problem is that we are using below line of code in this winforms application

Invoke(new MethodInvoker(
                  delegate { _logger.Error((String.Format("Error: {0}", _socketError))); }
                  ));

Can somebody guide what ca I do to use the above line of code in the windowserverice project

please suggest

Thanks

Update: I need to use invoke because this statement is running in the DoWork event of backgroundWorker component.

  • 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-06-01T19:37:09+00:00Added an answer on June 1, 2026 at 7:37 pm

    Since _logger is just writing to a log file, I do not understand the original intention behind using Invoke in the first place. I think you will be safe replacing that line with:

    _logger.Error(String.Format("Error: {0}", _socketError));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Like there are many Applications which are just basic but you can have install
I have been working on winforms using C# in my company for quite a
I have a WinForms application that requires some configuration which I do at install
I have a winform application which contains a window resizable but one requirement is
I have a console application which can also open winform under certain conditions.Processing(its a
We currently have a number of desktop applications (PowerBuilder, Winforms, WPF) that make use
I have a BizTalk 2006 app which has a sendport using MSMQ. I have
I have a winforms application in which some of the data is stored in
We have a couple of winforms applications that host a bunch of icons in
We have already shipped a client (.NET WinForms) application which sends customer data to

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.