Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Including text files in the published application

I made an application with C# and it reads text files located on my hard drive but how do I publish the application and include these text files in the final exe so when the application is installed on a different computer it would work and not fail because it cannot locate the text files? I'm using Visual Studio2010

like image 541
user612285 Avatar asked Dec 15 '25 13:12

user612285


1 Answers

In properties for the file in Visual Studio, change the Build Action from None (probably) to Content, or store it as a Resource file depending on where it needs to end up.

Of course if you are writing an installer just add it to the installed components.

like image 158
Adam Straughan Avatar answered Dec 17 '25 02:12

Adam Straughan