Mail.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 ("MailLicense.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 "MailLicense.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 "MailLicense.xml" file and click "Add" button.
- Right click on "MailLicense.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".
.NET and .NET Standard/.NET Core
"MailLicense.xml" should be in the run folder of your application. By default it is the folder your application's .exe file resides.
ASP.NET and WebServices
"MailLicense.xml" should be in the root folder of your web application (the folder with the "web.config" file).
Windows Services
"MailLicense.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.
Azure Functions
License file is loaded from the "bin" folder. Consider adding post-build step that copies the license file to the "bin" folder.
Getting exact path
You may use LicenseHelper class to obtain exact path from which the license is loaded:
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.
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 "MailLicense.xml" file
- Set "Publish Status" to: "Include"
- Set "Download Group" to "Required"
portable-win81+wpa81
You use LicenseHelper class to load the license file and check the license status. OnLaunched override is the best place:
portable-wpa81+wp81
You use LicenseHelper class to load the license file and check the license status. Application_Launching method is the best place: