0 votes

I am creating a web application which uses Web api.
Our Mvc Web application send mail information through an object of model to web api using httpPost. Api in turn calls another class library project to send mail where i have put reference to mail.dll

So now, where do i keep license file and where to i put the code:

new FileIOPermission(FileIOPermissionAccess.Read, fileName).Assert();

and

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

and do i need to put that code in global.asax
Please help. Thanks

by

1 Answer

0 votes

License file is loaded from the run folder of the application that uses Mail.dll (directly or indirectly through other assembly/library).

I assume you have only one ASP.Net application, that hosts both: ASP.Net Mvc and WebApi. Put you license in root folder of this app.

If WebApi is a separate application, put you license in this application.

Code should be placed in the global.asax file of the app mentioned above.

by (297k points)
I have different asp.net web application project, different asp.net webapi project for api and different class library project to send mail which i call from web api project.

I have kept the MailLicense.xml in web application project.

Should i keep it inside Web api project?
Thanks
If your WebApi project is a separate project that has Mail.dll referenced, you need to put your license there - in the root folder of the WebApi project.

There is no need to place the license in Web project, as it doesn't have Mail.dll referenced in any way.
...