0

In my project i need to specify full path of all files I am using. Can I just add folder containing all these files inside the solution and tell visual studio where to find them ? I need to do this because because every time i want to add one file i could just specify its name and extension.`

 //Instead of 
 OpenThis("c:\bla\bla\bla\cube.obj");

 //I could do just
 OpenThis("cube.obj");
`

I know you can just add file to a solution, but is there another way ?

Erik
  • 935
  • 11
  • 28
Tomas
  • 595
  • 1
  • 5
  • 14

1 Answers1

1

You can take a look at this

Also, you might want select "Copy if newer" under the "Properties->Copy to Output Directory" for the file you want to include.

This will ensure that the file will get copied over to the output directory.

Community
  • 1
  • 1
Chi Chan
  • 11,890
  • 9
  • 34
  • 52
  • Thanks for the answer! All of the solutions in your link suggests how to add directory within the source file. However, is there a way to add directory in the options within the current solution ? – Tomas Aug 22 '13 at 19:16
  • 1
    That might not be the best thing to do. For example, if "publish" your application, the code files will go away and you are left with only the .dll and .exe. That's why everything has to be relative to the "output directory" (which is the where your dll/exe sits). Unless... you are working with Web projects, that would be a different story – Chi Chan Aug 22 '13 at 19:28
  • It does make sense. I'll try doing that. – Tomas Aug 22 '13 at 19:33