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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:00:36+00:00 2026-05-10T17:00:36+00:00

This is a minor bug (one I’m willing to live with in the interest

  • 0

This is a minor bug (one I’m willing to live with in the interest of go-live, frankly), but I’m wondering if anyone else has ideas to fix it.

I have a C# WinForms application. When the app is launched via the executable (not via the debugger), the first thing the user sees is a console window, followed by the main window (after pre-loading is complete.)

I’d like to not display the console window. (Like I said, it’s a minor bug.)

The project output is already set to Windows Application.

Here’s (most of) the code for the Main() method. I’ve snipped out various proprietary/security related stuff, replacing it with comments where appropriate.

[STAThread] static void Main() {     try     {         Application.EnableVisualStyles();         Application.SetCompatibleTextRenderingDefault(false);          // SNIP: Get username from Windows, associate with DB user          if (user == null || user.UID == 0 || (user.Active.HasValue && !(user.Active.Value)))         {             MessageBox.Show(ErrorStrings.UnknownUser, ErrorStrings.TitleBar, MessageBoxButtons.OK,                 MessageBoxIcon.Error);             Application.Exit();             return;         }          // SNIP: Associate user with employee object              Application.Run(new MainForm());     }     catch (Exception ex)     {         if (ExceptionPolicy.HandleException(ex, UiStrings.ExceptionPolicy))         {             string message = ErrorStrings.UnhandledPreface + ex.ToString();             MessageBox.Show(message, ErrorStrings.TitleBar, MessageBoxButtons.OK, MessageBoxIcon.Error);             Application.Exit();         }     } } 

Anyone have 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. 2026-05-10T17:00:37+00:00Added an answer on May 10, 2026 at 5:00 pm

    My first guess would be to double check your Project Property settings and make sure that the output type is Windows Application and not Console Application.

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

Sidebar

Related Questions

I was wondering if anyone could help me with this minor problem. I want
I'm using the Borland (AKA Embarcodegearland) C++Builder 2007 compiler which has a minor bug
There's a minor but annoying bug, I think, in the Eclipse built-in Java formatter.
I have a question very similar to this one but the answer does not
This bug has given me hours of anguish. This is a simplified version of
Currently I'm using this minor bit of javascript to remove a small list of
Okay, this is just a minor caveat. I am currently working with the lovely
This should be a simple one: I have an observableArray object called To in
I know it's a minor annoyance.. but it's still an annoyance and it baffles
It seems that each Ajax History and Bookmark plugin has some minor bugs, ranging

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.