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?
Typically, the primary license file is stored in the application directory or created on first execution in the application folder or the registry, one or more aliases are stored in the Windows Registry, Windows, or Windows\System(32) directory.
If you cannot open your LIC file correctly, try to right-click or long-press the file. Then click "Open with" and choose an application. You can also display a LIC file directly in the browser: Just drag the file onto this browser window and drop it.
A LICENSE file is a software license file commonly used by commercial software applications. It contains registration information that allows a registered user to open and access a piece of software. Many commercial software applications require users to purchase a license in order to use them.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With