开发者

How to include specific folders on build with visual studio

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 select the folders I want to include with 开发者_开发技巧the build.


  1. show all file
  2. right click on the file -> include in project

    How to include specific folders on build with visual studio

  3. right click on the file -> property
  4. set "Copy to output directory" as "Copy Always"

    How to include specific folders on build with visual studio


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


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.


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜