How do I include license (.lic) files in my bin folder while ensuring they're covered by source control?
reference, version-control, visual-studio, visual-studio-2012
Solution
The way I accomplished this was to place my license files in the project root (I imagine you can place them anywhere within the project). Then, I set their properties (ctrl-click each .lic file and press Alt+Enter, or click the Properties tab):
Setting `Copy to output directory` to "Copy always" causes the files to be moved to the `bin` folder at build time.
Setting `Build action` to "None" prevents the files from being published at their original location along with the other content. Without this setting, the license files would be published at the website root and could be downloaded.
Problem
I've got a few license files (.lic) that are required by various third-party components, each of which requires the presence of the license file within the `bin` folder. Because I've omitted my `bin` folder from source control, references and license files placed in `bin` are not source controlled. As per this answer, I moved my pre-compiled references to another location that is covered by source control and reference them in my project by way of a relative path. When I build, those DLLs are properly included in my `bin` folder. As far as I know, I cannot use the same method for my license files. They must be stored within my Visual Studio project. In Visual Studio, how can I store my license files in a location covered by source control and have them published to my `bin` folder at build time?