Where does Visual Studio search for txt files when conducting file management operations?

后端 未结 4 2090
攒了一身酷
攒了一身酷 2020-12-20 15:00

I know this is a noob question, but I\'ve worked with Python before and when you wanted to simply access a .txt file for example, all you had to do was make sure the txt fil

4条回答
  •  长情又很酷
    2020-12-20 15:35

    Visual Studio sets the working directory to YourProjectDirectory\Debug\Bin when running in debug mode. If your text file is in YourProjectDirectory, you need to account for that difference.

    The easiest way to do that is to include your text files in the project and set their build action (in the Properties window) to Content.

提交回复
热议问题