Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Internet Service Providers hosting multiple applications from different companies primarily enforce a Medium Trust security level. Moreover, sometimes you need to host multiple applications on a shared server, such as in an ISP or other scenarios, and you have to use the Medium Trust level to constrain the applications. The ASP.NET Medium Trust level provides a constrained execution environment that is suitable for isolating multiple applications hosted on ISP servers. In .NET 2.0, such a security level may impose the following constraints which could affect the ability of Aspose.Cells for .NET to perform properly, for example:
You may follow some recommendations to run Aspose.Cells for .NET on a Medium Trust level or shared server environment:
License.SetLicense(Stream) method after obtaining the license file as a stream.See the following example that demonstrates how to use/run Aspose.Cells for .NET in Medium Trust mode.
// Instantiate the License object
Aspose.Cells.License lic = new Aspose.Cells.License();
// Get the license file into a stream
System.IO.Stream stream = System.IO.File.OpenRead(MapPath("~") + @"\Aspose.Cells.lic");
// Set the License stream
lic.SetLicense(stream);
// Close the stream
stream.Close();
// Set the fonts directory
CellsHelper.FontDir = MapPath("~") + @"\Fonts";
// Open the template file
Workbook workbook = new Workbook(MapPath("~") + @"\test.xlsx");
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
// Set the image type to another format instead of the default EMF
pdfSaveOptions.ImageType = System.Drawing.Imaging.ImageFormat.Png;
// Save the PDF file
workbook.Save(MapPath("~") + @"\dest.pdf", pdfSaveOptions);
// Save the XLSX file
workbook.Save(MapPath("~") + @"\dest.xlsx");
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.