How to include license files (.lic) in the bin folder, ensuring that they are covered by source control?

I have several license files (.lic) that are required for different third-party components, each of which requires a license file in the bin folder.

Since I lowered my bin folder from the source control, the links and license files hosted in bin are not controlled by the source. According to this answer, I moved my precompiled links to another place, which is covered by the source control and refers to them in my project by a relative path. When I create these DLL files are correctly included in my bin folder.

As far as I know, I cannot use the same method for my license files. They should be stored in my Visual Studio project. In Visual Studio, how can I store license files in the location covered by the version control and publish them to my bin folder during build?

+7
version-control reference visual-studio visual-studio-2012
source share
2 answers

The way I did this is to place the license files in the root of the project (I think you can place them anywhere in the project). Then I set their properties (ctrl-click for each .lic file and press Alt + Enter or go to the "Properties" tab):

Properties

Setting Copy to output directory to Copy Always causes files to move to the bin folder during build.

Setting the Build action to "None" prohibits the publication of files in the original location along with other content. Without this setting, license files will be published to the root website and can be downloaded.

+11
source share

You can add the settings below to the Web.config file, this will ensure the publication of the license file

 <configuration> <system.web> <compilation> <buildProviders> <remove extension=".lic"/> <add extension=".lic" type="System.Web.Compilation.ForceCopyBuildProvider"/> </buildProviders> </compilation> </system.web> </configuration> 
0
source share

All Articles