Could not find file .. \ bin \ Debug \ content.dat

I added the content.dat file to my Visual Studio project in the same place where form1.cs is located. But when I try to read or write to a file, I get this error:

Could not find file '...\bin\Debug\content.dat'.

Why is he trying to find it in bin \ Debug? Where do I need to put this file so that it can be easily read / written later, and I also need to create an installer for this, will the link path be distorted again?

+3
source share
2 answers

Presumably because you work in bin\Debug- where the application starts.

- "", . EDIT: , " " " " ", ".

+9

.dat visual studio , ,

+1

Source: https://habr.com/ru/post/1756185/


All Articles