HomeHome Product Discus... Product Discus...SmithCartSmithCartPrint Invoice ErrorPrint Invoice Error
Previous
 
Next
New Post
2/24/2016 1:34 PM
 
Print button doesn't work in Orders module. 
Partial Error Log entry...
"

Message:That assembly does not allow partially trusted callers.

StackTrace:


 

InnerMessage:That assembly does not allow partially trusted callers.

InnerStackTrace:

 at Smith.DNN.Modules.BuyNow.PDFUtility.GetPDFFromHtml(String htmlText) at Smith.DNN.Modules.BuyNow.Invoice.PopInvoice(String invoiceHTML)"

Please advise.
 
New Post
2/24/2016 2:43 PM
 
We use the iTextSharp dll to create the PDF invoices.  The iTextSharp dll requires your site be running full trust.  Here is an article on how to make it work in medium trust environments.  

http://instantdevelopment.blogspot.com/2009/10/itextsharp-pdf-rendering-in-medium.html

In the future we will look into distributing the modified iTextSharp dll that runs in medium trust.

Thanks for the feedback!

At your service,
Dave Smith
DotNetNuke Consulting, DotNetNuke Store and DNN Ecommerce
 
New Post
2/25/2016 3:49 AM
 
I'm not a Visual Studio user, so I probably did something wrong....

I applied the 'fix' suggested in article (adding [assembly: AllowPartiallyTrustedCallers()] to AssemblyInfo.cs) and uploaded the recompiled isharptext.dll file (ver 5.5.3.0) to bin directory. I recycled app pool, cleared cache and restarted dnn application.

That+assembly+does+not+allow+partially+trusted+callers. error still occurring. My web.config file trust is set to Medium. Have also tried setting trust to Full with out success. 

If I understand your response you are saying you ship the product and that the print feature does not work on many shared hosting environments and that you might fix this in the future?

If you could fix this issue now and start with the one I just bought that would be super!

 
New Post
2/26/2016 2:25 PM
 
Please use the following link to download and deploy the iTextSharp dll's which build with AllowPartiallyTrustedCallers attribute

http://www.smith-consulting.com/Portals/0/Downloads/iTextSharp/iTextSharp_5.5.3_medium_trust_environment.zip
 
New Post
2/26/2016 4:54 PM
 
Thank You! I didn't realize that all three needed to be modified.
Making progress.... now when I print invoice:

InnerMessage:Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

InnerStackTrace:

InnerMessage:Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
InnerStackTrace:
   at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
   at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark)
   at System.Security.CodeAccessPermission.Demand()
   at System.Environment.InternalGetFolderPath(SpecialFolder folder, SpecialFolderOption option, Boolean suppressSecurityChecks)
   at System.Environment.GetFolderPath(SpecialFolder folder)
   at iTextSharp.text.FontFactoryImp.RegisterDirectories()
   at iTextSharp.tool.xml.XMLWorkerFontProvider..ctor(String fontsPath, Dictionary`2 fontSubstitutionMap)
   at iTextSharp.tool.xml.pipeline.html.HtmlPipelineContext..ctor(CssAppliers cssAppliers)
   at iTextSharp.tool.xml.XMLWorkerHelper.ParseXHtml(PdfWriter writer, Document doc, TextReader inp)
   at Smith.DNN.Modules.BuyNow.PDFUtility.GetPDFFromHtml(String htmlText)
   at Smith.DNN.Modules.BuyNow.Invoice.PopInvoice(String invoiceHTML)
   at Smith.DNN.Modules.BuyNow.Invoice.LoadData(Int32 orderID, String invoiceType)
   at Smith.DNN.Modules.BuyNow.Invoice.Page_Load(Object sender, EventArgs e)
   at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) I did change web.config trust level from Medium to Full without success.
 
New Post
2/29/2016 12:43 PM
 
AH HA. Working now.
I had changed the
< trust level="Full" />
   in web.config but neglected to REMOVE IT FROM THE COMMENT TAG :-P
Once that was accomplished it works as designed in medium trust environment on shared hosting.
Thanks for the help.
 
Previous
 
Next
HomeHome Product Discus... Product Discus...SmithCartSmithCartPrint Invoice ErrorPrint Invoice Error