We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

SetLicense FileLoadException

Greetings,



I need to use Aspose PDF during coded UI testing but am having trouble setting the license from within a running unit test class. The code works as part of console application just fine. Please see the attachment screen clipping for the exception and the code it stems from. I do not know of any similar scenarios that have been posted to the forums here.



Thanks

Hi Anthony,


Thanks for contacting support.

Can you please share some sample VS Test Project so that we can test the scenario at our end. Please ensure to exclude the license file from solution. We are sorry for this inconvenience.

I’ve attached a simple CodedUI project along with a support project. Please bring your attention to the function MyTestInitialize in the CodedUITest1 class in the LoadAspose project.


Thanks for the help.

Hi Anthony,


Thanks for sharing the sample project.

I am working on replicating the issue using this sample and will keep you updated with my findings.

Hi Anthony,


Thanks for your patience.

I have tested the scenario using VisualStudio 2013 where I have used Aspose.Pdf for .NET 9.7.0 in sample project which you have shared and I am unable to notice any problem. In order to execute all tests, I have used TEST -> Run -> All Tests option. The project is built successfully and then I have observed that Notepad application is launched using Windows Run command and in Notepad application, View -> Status Bar menu option is selected.

In case there are any specific steps to test the scenario, please share some further details.

Nayyer,


Thanks for taking the time to run the sample test project. There are no other steps you can take in regards to executing it. I have also tried to run the application and continue to receive the error shown in the attachment. Could the discrepancy in our results be caused by the type of licenses being used by each of us? I am attaching a screen shot of the embedded license resource for your inspection. Please let me know if our license is not permitting the type of use I am attempting.

Tony


Second screen shot

Hi Tony,


I have tried replicating the issue while using license file which you have shared and I am unable to notice any problem. However I am working on replicating the problem over another machine and will keep you posted on the status of correction.

Hi Tony,


Thanks for your patience.

I have again tested the scenario using Aspose.Pdf for .NET 9.7.0 in VisualStudio 2013 where I have set target framework as .NET Framework 4.5 and I am unable to notice any issue. I have used the same license file (with Build Action as Embedded Resource) in project which you have shared earlier. Can you please share which version of .NET Framework and OS you are using.

We are sorry for this delay and inconvenience.

Thanks for checking this out for me. At this point it is working for me, although I do not know exactly why. Please go ahead and close out the ticket if you have not already done so.



Thanks Again!


Hi Tony,


Thanks for the acknowledgement.

We are glad to hear that your problem is resolved. Please continue using our API and in the event of any further query, please feel free to contact.

PS, BTW we were also unable to replicate the issue in our environment.