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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:53:31+00:00 2026-05-15T23:53:31+00:00

I have a C# project that compiles normally. When I run the project via

  • 0

I have a C# project that compiles normally. When I run the project via Visual Studio’s IDE it runs fine and ends cleanly. However when I navigate to the project directory and attempt to run the program by double clicking the “exe” file or referencing it via the run window it errors out.

I have narrowed the problem down to

Console.WriteLine("output ->" + any_variable);

For some reason if I print any variable using the console.writeline the application will error if ran as described earlier.

If I take this line out, the executable created by the Visual Studio will run just fine if i double click on it. I’m really confused by this. My goal here is to create this command line project as a scheduled task.

  • 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-15T23:53:31+00:00Added an answer on May 15, 2026 at 11:53 pm

    I’d assume the error not having anything to do with WriteLine or even a Console. While a common a difference between running from IDE and running from double-clicking might be the rights (i.e., you may start the IDE as admin, or the location that you are writing/reading from/to is different and has different ACLs attached to it), thiis doesn’t seem to be the case here.

    To catch your actual error, compile into debug mode. Start your application (possibly with a message box of some kind). Start the IDE and select Debug and Attach to process (you have all the time if you pause your app with a message box). Select your process. Run until you receive the error. You should now receive the error in the IDE, even though the app is run from double clicking the EXE. You can see the stack and debug as you would normally do.

    My guess? The variable you’re printing does something that raises the error.

    Altenatively: a simple try/catch around the offending statement plus a messagebox with the Exception.Message should give you some more intel too.

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

Sidebar

Related Questions

I have a project that compiles and runs fine on my development machine but
I have an FLTK project that I finished in visual studios and it compiles
I have a Visual Studio 2010 project with C++ code that I want to
I have a game code (from ioquake3 project) that compiles part of gameplay binaries
I have a project that defines an idl and it compiles it using MIDL.
OK, so I have a C++ project that compiles to a DLL file. I
I have an issue where every time I try to run a project (that
If you have a project that utilizes a makefile which compiles multiple files and
I run an open source project that normally distributes our code in a universal
I have a Visual Studio 2010 C++ project which was copied from another visual

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.