How to include certain folders in the assembly with visual studio

I want to add the assembly folder in visual studio. This folder contains my .sqlite file, and I need it with my exe file. I was wondering where in the visual studio I can select the folders that I want to include in the assembly.

+7
source share
4 answers
  • show whole file
  • right click on the file -> include in project enter image description here
  • right click on the file -> property
  • set "Copy to output directory" as "Always copy" enter image description here
+10
source

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

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

+3
source

I would say that you move your .sqlite file to \yourproject\bin\ or refer to it in your project (as someone already explained).

.sqlite will work more at runtime rather than at compile / build time, so including it in the assembly will not be the solution to your problem.

The correct solution should be to include your .sqlite as a resource in your project so that it can access the runtime.

+1
source

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

I found this post on the MSDN blog: 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 a web application project for packaging using web deployment. To empty a packed and expanded directory, we can get around this by adding an empty stub file inside the directory to make it non-empty. The deploy website will then package and deploy the directory with a stub.

0
source

All Articles