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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:04:55+00:00 2026-06-15T18:04:55+00:00

I am using Visual Studio 2010 and C#. I have the following code which

  • 0

I am using Visual Studio 2010 and C#. I have the following code which simply writes and creates a log file:

StreamWriter file = File.AppendText("YouTube_Logfile.txt");

My program works on the system I built it.

But it doesn’t write to the log file as soon as I take it and run it on another machine. All other functionality of the program is working as expected.

I have even deleted the system.dll referrence and re-linked it to a local copy of the program, so system.dll is also being copied over.

[adding]: I don’t get any errors, just no log file created.

Thanks in advance,
Bruce

  • 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-15T18:04:57+00:00Added an answer on June 15, 2026 at 6:04 pm

    I suspect the cause is that it is creating the log file in an unexpected directory because, when it runs, that is the current directory. Your application should probably either include the directory in your path or change the current directory as appropriate.

    Beyond that, you haven’t provided enough information for a definitive answer. Any time you work with files, you should have some exception handling to appropriately propagate any errors. Then you’d have some idea what is going wrong. –

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

Sidebar

Related Questions

I have the following code which works in a Visual Studio 2010 WCF project.
i am using visual studio 2010. i have a three dimensional structure array which,
I have a asp.net website with c# code behind and using visual studio 2010.
I have the following code snippet. This is a c file in visual studio
I have added the following code in my C#.net application in visual studio 2010
I have the following struct in my C++ code (I am using Visual Studio
We have developers using Visual Studio 2010 professional and some trying out Visual Studio
I have compiled this using Visual Studio 2010 compiler and it has compiler error
I have created SQL Server 2008 Database project using visual studio 2010. after build
For reference, I'm using Visual Studio 2010. I have a custom build step defined

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.