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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:15:49+00:00 2026-06-13T02:15:49+00:00

I have a file that I store some site links. Until now I used:

  • 0

I have a file that I store some site links. Until now I used:

string path = Environment.CurrentDirectory + "/forumlinks.txt";

But I want to store the file in the release folder so I can change it and I know it will change permanently for the user.

So I changed to this:

string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"/forumlinks.txt";

But I get an exception:

System.IO.FileNotFoundException.

My question: is this the right way to get the file from the release folder? Should I rethink that and store him in a different place? If so I will be glad to hear about it.

  • 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-13T02:15:50+00:00Added an answer on June 13, 2026 at 2:15 am

    Hard coding a path to your code release folder is dangerous. What if you want to build in debug mode for some reason? What happens when you want to deploy your program?

    A better choice would be to use the environment’s application data folder. This will be different for each user, so it means that each user can have their own version of the file.

    See this post for details of how to get the application data folder.

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

Sidebar

Related Questions

I have semicolon-separated .dat file and I want to read that file and store
I have an XML based file format that I'm using to store and load
I need to store some information that is unique for each site that my
On my site I have a config file which has many settings that need
I have a file that stores exam scores for a class of students. I
I have a text file that stores combinations of four numbers in the following
I'm definitely missing something. I have an XML file that stores HTML snippets, as
I have to read/write an XML file that stores its data as bit masked
I have a log file in SqlServer that stores the time an application started,
We have an applet, a jar file that is stored on the desktops and

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.