+1 vote

I am using mail.dll in a WebJob hosted on the Azure App Service. This runs as a console app alongside the website, but not hosted in the same directory.

I have copied the MailLicense.xml into both the website root directory, and the webjob root directory. however, I am still getting "Please purchase Mail.dll license...".

Do you have any steer on this?

Thanks, Max

by (250 points)

1 Answer

0 votes

Please check the value of:

string fileName = Limilabs.Mail.Licensing.LicenseHelper.GetLicensePath();

You can also easily test if license was loaded properly:

LicenseStatus status = Limilabs.Mail.Licensing.LicenseHelper.GetLicenseStatus();

if (status != Limilabs.Licensing.LicenseStatus.Valid)
    throw new Exception(
        string.Format("License is not valid: {0} ({1}).", status, fileName));
by (298k points)
edited by
OK therein lies the problem!  Each invocation seems to have a different path...

License Path: D:\local\Temp\jobs\continuous\LinkExBackgroundTasks\lite3w33.43f\MailLicense.xml
License Path: D:\local\Temp\jobs\continuous\LinkExBackgroundTasks\rxduonjq.jhb\MailLicense.xml

It's running it in a temp directory.  Is it possible to load it as a resource instead?

Thanks, Max
Yes, you can add the license file as an embedded resource. It will be picked up automatically.