none
Could not load type iTextSharp.text.html.HtmlParser RRS feed

  • Pergunta

  • Olá!

    Alguém tem alguma sugestão para o erro abaixo? Na tentativa de gerar um PDF com  iTextSharp versão 5.0.6.0 e razorPDF versão 1.0.0.0 retorna esse erro, eu estou usando o MVC4 C#. Já tentei desinstalar e instalar novamente e o erro mantem-se:

    Server Error in '/' Application.

    Could not load type 'iTextSharp.text.html.HtmlParser' from assembly 'itextsharp, Version=5.0.6.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca'.

    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.TypeLoadException: Could not load type 'iTextSharp.text.html.HtmlParser' from assembly 'itextsharp, Version=5.0.6.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca'.

    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: 
    [TypeLoadException: Could not load type 'iTextSharp.text.html.HtmlParser' from assembly 'itextsharp, Version=5.0.6.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca'.]
       RazorPDF.PdfView.Render(ViewContext viewContext, TextWriter writer) +0
       System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +294
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
       System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +23
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
       System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +175
       System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +89
       System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +102
       System.Web.Mvc.Async.WrappedAsyncResult`1.End() +57
       System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +43
       System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14
       System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
       System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
       System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +57
       System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
       System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
       System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +47
       System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
       System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25
       System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
       System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
       System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +47
       System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9651796
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
    


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34249
    <iframe frameborder="0" id="FirebugUI" src="about:blank" style="border-width:0px;border-style:initial;visibility:hidden;z-index:2147483647;;width:1745.45446777344px;left:0px;bottom:0px;height:335px;"></iframe>

    sexta-feira, 29 de maio de 2015 23:03

Todas as Respostas

  • Eu tomei como exemplo do endereço abaixo, mas sem sucesso:

    http://www.dotnetjalps.com/2013/06/Creating-PDF-with-ASP-Net-MVC-and-RazorPDF.html

    Neste exemplo a versão do iText é 4.1.2 que está ultrapassada. Até tentei com esta versão, também sem sucesso. No Chrome aparece um mensagem "Carregando..." e nada acontece. No FireFox a tela fica preta.

    segunda-feira, 1 de junho de 2015 02:57