Aspose.Pdf and Medium trust

Hi Nayyer

Thank you for your reply. Despite Medium Trust being obsolete, it appears our hosting company still maintains this as a requirement. What are our options? Older DLL? Custom DLL? Other?

Note we run Aspose Cells on the same hosted environment with no problems.

I'm open to all suggestions and would really love to be able to use your aspose.pdf product in the same way we currently use aspose.cells.

Many thanks
Phil

Hi Phil,


Thanks for sharing the details.

I am further discussing these details with development team and will get back to you soon.

Hi Phil,


Thanks for your patience.

I have further discussed the scenario with product team and in current circumstances, you may consider following either approach

  1. Use old version of API (version 9.2) which was tested and worked well under medium trust.
  2. Please try using latest release and in case you encounter any issues, please share the details and we will investigate and fix them.
Hi

I've tried using the older DLL 9.2, but still get this error:

Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SecurityException: Request failed.]
      .() +0
   .cctor() +8


Here is the assembly info for the older DLL:

Attributes:
<System.Reflection.AssemblyCopyrightAttribute("Copyright 2002-2013 Aspose Pty Ltd"),
System.Reflection.AssemblyTrademarkAttribute(""),
System.Reflection.AssemblyProductAttribute("Aspose.Pdf"),
System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4"),
System.Reflection.AssemblyCompanyAttribute("Aspose Pty Ltd"),
System.Diagnostics.DebuggableAttribute(2),
System.Runtime.CompilerServices.RuntimeCompatibilityAttribute(WrapNonExceptionThrows = True),
System.Runtime.CompilerServices.CompilationRelaxationsAttribute(8),
System.Reflection.AssemblyInformationalVersionAttribute("2014.04.26"),
System.Reflection.AssemblyTitleAttribute("Aspose.Pdf"),
System.Reflection.AssemblyDescriptionAttribute("A .Net Pdf Component"),
System.Reflection.AssemblyConfigurationAttribute(""),
System.Runtime.InteropServices.ComVisibleAttribute(True),
SmartAssembly.Attributes.PoweredByAttribute("Powered by SmartAssembly 5.5.0.153"),
System.Runtime.CompilerServices.SuppressIldasmAttribute,
System.Reflection.AssemblyFileVersionAttribute("5.5.0.153")>

Hi Phil,


Thanks for sharing the details.

We are further look into the details of this information and will get back to you soon.
Hi Nayyer

Thank you for your prompt response. I'm doing a little more investigation at my end. I'll hopefully get back to you with more detailed information soon.

Many thanks
Phil

Hi Phil,


Thanks for contacting support.

Please take your time and note that we already have tested Aspose.Pdf for .NET 9.2 in trusted environment and it worked without any problem. In case the problem still occurs, please share some details on how you have used the API and if possible, please share a sample project, so that we can further investigate the scenario in our environment. We are sorry for this inconvenience.
Thanks again Nayyer

I am now using v9.2 and I'm getting the following error.

Cannot find license 'Aspose.Pdf.lic'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Cannot find license 'Aspose.Pdf.lic'.

Is there anything unusual about the way v9.2 handles license files?

Kind regards
Phil

Hi Phil,


Thanks for sharing the details.

There has been no change related to license initialization in recent release versions. However concerning to above error message, ensure that license file is preset and has same name as specified in code snippet and also ensure that your application has access to location containing license file.

In case the issue still occurs, can you please share if the same issue occurred when tested the latest release versions. We are sorry for this inconvenience.
Hi

I tried version 9.2.1 (instead of 9.2.0) and now get this error:

Server Error in '/' Application.

Cannot find black listed licenses resource. Please report this error to Aspose.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Cannot find black listed licenses resource. Please report this error to Aspose.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidOperationException: Cannot find black listed licenses resource. Please report this error to Aspose.]
   š..e() +527
   š..˜(Stream ) +156
   š..˜(String , Assembly ) +133
   Aspose.Pdf.License.SetLicense(String licenseName) +86
   TimeProWebApp.GeneratePDF.Page_Load(Object sender, EventArgs e) +787
   System.Web.UI.Control.OnLoad(EventArgs e) +92
   System.Web.UI.Control.LoadRecursive() +54
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.36366

Does this provide any clues?

Regards
Phil

Hi Phil,


Thanks for sharing the details.

As per problem description, it appears to be an issue with the license file. Can you please share the license file by following instructions specified over How to send a license?

We will test the scenario and will share our findings. We are sorry for this inconvenience.