How to include specific folders on build with visual studio

前端 未结 4 1477
抹茶落季
抹茶落季 2021-01-04 13:35

I want to include a folder with the build in visual studio. This folder contains my .sqlite file and I need it with my exe file. I was wondering where in visual studio I can

相关标签:
4条回答
  • 2021-01-04 14:09

    While the above answers are correct (and should be marked as so), there may be another scenario where your applications resources may not be static (and therefore cannot be added as resources to the solution). In these cases you can use a post-build command in the project properties window to manually copy files to the output directory..

    XCOPY $(SolutionDir)MyDynamicResourcesFolder*.* $(OutputDir)MyDynamicResourcesFolder

    0 讨论(0)
  • 2021-01-04 14:09

    A little late but I had the same question but wanted to include an empty directory.

    I found this MSDN blog post: http://blogs.msdn.com/b/webdevelopertips/archive/2010/04/29/tip-105-did-you-know-how-to-include-empty-directory-when-package-a-web-application.aspx

    By design, Visual Studio 2010 will skip the empty directory when packaging web application project using web deploy. To get empty directory packaged and deployed, we can work around this by adding an empty stub file inside the directory to make it non-empty. Then web deploy will package and deploy the directory with the stub file.

    0 讨论(0)
  • 2021-01-04 14:17

    I would say you move your .sqlite file to \yourproject\bin\, or reference it in your project (like someone already explained).

    The .sqlite would rather be rear at execution time, not at compile/build time, so including it in the build won't be a solution to your problem.

    The right solution should be to include your .sqlite as a resource in your project, so it can access to it an runtime.

    0 讨论(0)
  • 2021-01-04 14:23
    1. show all file
    2. right click on the file -> include in project enter image description here
    3. right click on the file -> property
    4. set "Copy to output directory" as "Copy Always" enter image description here
    0 讨论(0)
提交回复
热议问题