I was working with the evaluation copy on a local machine and it was working successfully.
But when I moved the code to a web server, it started throwing the following 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 for the permission of type System.Security.Permissions.StrongNameIdentityPermission, mscorlib, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 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:
|
Could someone please help as I was looking forward to giving a demo to the client .
thanks in advance.
Following is the main block. I suspect bindxml is creating the problem ??
Dim pdf As Pdf = New Pdf()
pdf.PageSetup.PageWidth = 1000
pdf.IsTruetypeFontMapCached = False
' If you have purchased a Website, Webserver or Weboem License,
' Set license like this:
'Dim licenseFile As String = MapPath("License") + "\\Aspose.Pdf.lic"
'pdf.SetLicense(licenseFile, this)
Dim xmlFile As String = path + "\\ASPOSE.PDF\\Xml\\Invoice.xml"
pdf.BindXML(xmlFile, Nothing)
Dim headerFooter As HeaderFooter = pdf.Sections(0).OddHeader
Dim logoImage As Image = CType(headerFooter.Paragraphs(0), Image)
'ogoImage.ImageInfo.File = path + "\\ASPOSE.PDF\\Images\\logo1.jpg"
logoImage.ImageScale = 0.74F
Dim Footer As HeaderFooter = pdf.Sections(0).OddFooter
Dim text As Aspose.Pdf.Text = CType(Footer.Paragraphs(0), Aspose.Pdf.Text)
Dim seg As Segment = text.Segments(0)
seg.Content = "Confidential - " + seg.Content
Me.oleDbSelectCommand1.CommandText = _
"SELECT DISTINCTROW Orders.OrderID FROM Orders ORDER BY Orders.OrderID DESC;"
resultReader = Me.oleDbSelectCommand1.ExecuteReader()
Dim ordersNumber As Integer = 0, number As Integer
Dim orderIDs() As Integer = New Integer(2048) {}
While resultReader.Read()
orderIDs(ordersNumber) = Convert.ToInt32(resultReader.GetValue(0))
ordersNumber = ordersNumber + 1
End While
resultReader.Close()
'for(number = 0; number < ordersNumber; number++)
'We generate invoices for the first 100 orders for demo only. If you want to
'generate all invoices,uncomment the line above and comment the line below.
For number = 0 To 10 - 1 Step 1
Me.oleDbSelectCommand1.CommandText = "SELECT * FROM (" + invoiceStr & _
") WHERE ((Orders.OrderID)=" + orderIDs(number).ToString() + ")"
resultReader = Me.oleDbSelectCommand1.ExecuteReader()
PutOrder(pdf, resultReader)
resultReader.Close()
Next
Me.oleDbConnection.Close()
Return pdf