Barcode.dll - After purchase
Thank you for your purchase.
The following tutorial will help you configure your application correctly and put the license file in appropriate place.
License file ("BarcodeLicense.xml" you received after purchase via email or download link) is loaded from the run folder of your application (AppDomain.CurrentDomain.BaseDirectory).
Configuring license file in Visual Studio
In Visual Studio 2005, 2008, 2010, 2012, 2013, 2015, 2017, 2019, 2022 you can configure "BarcodeLicense.xml" file in your project, so it's always copied to your output directory:
- Right click on your project in Visual Studio in Solution Explorer.
- Click "Add" then "Existing item..."
- In "Files of type:" combo choose "All Files (*.*)".
- Browse to "BarcodeLicense.xml" file and click "Add" button.
- Right click on "BarcodeLicense.xml" file in Solution Explorer and click "Properties".
- On Properties pane change "Copy to Output Directory" option to "Copy if newer", and "Build Action" to "Content".
Visual Studio 2003
In Visual Studio 2003 you should copy the license file manually. In case of Example1 project this path should be:
- "Example1\bin\Debug" in debug mode
- "Example1\bin\Release" in release mode
ASP.NET and WebServices
"BarcodeLicense.xml" should be in the root folder of your web application (the folder with the "web.config" file).
WindowsServices
"BarcodeLicense.xml" should be in the run folder of your windows service. By default it is the folder your service's .exe file resides.
Please use the LicenseHelper described below to check the exact path.
ClickOnce
First configure the license file so it's copied to the output directory as described above.
- Right click on your project in Visual Studio in Solution Explorer.
- Select "Properties"
- Go to "Publish" tab
- Click "Application files..."
- Configure "BarcodeLicense.xml" file
- Set "Publish Status" to: "Include"
- Set "Download Group" to "Required"
Security
Remember also that your application needs to have read access to this file. It is especially important when, for example, you are developing WindowsService that runs on specific Windows account. Please make sure that the user in context of which the service is running has enough permissions to access to this file.
Library uses following code to assert that it has permissions to read the file:
Checking license status
License file is read once per application-run, so remember to restart your application after placing the file in appropriate folder.
You can use LicenseHelper class to obtain the exact path, and the current status of the license:
Machine key store
In rare cases when you use impersonation you'll need to put the following line in your application start up code (e.g. in Global.asax in Application_Start method). It tells .NET runtime to persist keys in the computer's key store instead of the user profile store.
COM object
After obtaining BarcodeFactory check GetLicenseFolder method. It returns folder path from which the component will load the license file (BarcodeLicense.xml). Here is the sample VBS code: Usually it should be 'c:\Windows\System32' or 'c:\WINNT\System32' folder.
Classic ASP 3.0
After obtaining BarcodeFactory check GetLicenseFolder method. It returns folder path from which the component will load the license file (BarcodeLicense.xml). Here is the sample ASP code: Usually it should be 'c:\Windows\System32' or 'c:\WINNT\System32' folder. Restarting IIS server might be required.
Design time appearance of ASP.NET and WindowsForm controls
Please copy "BarcodeLicense.xml" to:
- Visual Studio 2010 - "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE"
- Visual Studio 2008 - "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE"
- Visual Studio 2005 - "C:\Program Files\Microsoft Visual Studio 8\Common7\IDE"
- Visual Studio 2003 - "C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE"
Please remember to restart the Visual Studio.