Search code examples
xmlvb.netvisual-studiofile-accessresource-files

Where can I set in Visual Studio, that the published and installed solution could acces the resource folder? (Not just in debug mode...)


My project has a resource folder that contains pictures and xml files. The program can access the files just in debug mode. When I installed the solution, and run the program it doesn't work. How can I publish my Win Forms solution that it could access the resource folder after install? Here is my VB code that can pretty good access the files in runtime: myPath = "myResources\" & fileName & ".xml"


Solution

  • The correct path is this: myXmlPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "MyXmlFolder", myFileName & ".xml") The correct properties for the files: -Build action: Content -Copy to Output Directory: Copy if newer