Unhandled exception in C1.WPF.Pdf.4.dll

Posted by: sivakumar_sridharan on 29 October 2018, 10:21 pm EST

    • Post Options:
    • Link

    Posted 29 October 2018, 10:21 pm EST

    Hi,

    Hope someone can assist us on this.

    We are using C1PdfDocument class to generate PDF. It had been working fine before. However, we are facing an unhandled exception as described below. This exception is being thrown at DrawString method if that may helps. Please let me know if you need anymore information. Thanks

    Version Details:

    C1.WPF.Pdf.4.dll - Product Version 4.0.20171.549

    Exception Details as below:

    An exception of type ‘System.IO.FileNotFoundException’ occurred in C1.WPF.Pdf.4.dll but was not handled in user code

    Additional information: Could not load file or assembly ‘C1.WPF.DX.4, Version=4.0.20171.549, Culture=neutral, PublicKeyToken=2aa4ec5576d6c3ce’ or one of its dependencies. The system cannot find the file specified.

  • Posted 30 October 2018, 6:21 pm EST

    Hello,

    We regret that you are facing issues with ComponentOne.

    The exception ‘Could not load file or assembly’ is most likely to occur when Visual Studio is not able to find this specific dll.

    The reason for this exception for you might be that when you upgraded ComponentOne, the Specific Version of C1.WPF.DX.4 dll in your project might have been left true. Due to this all dlls at ‘C:\Program Files (x86)\ComponentOne\WPF Edition\bin\v4’ location are replaced by their respective new versions but the Visual Studio is still looking for this dll of last version (due to SpecificVersion=true).

    Resolution:

    • "* “Find the C1.WPF.DX.4 dll in your project and set its Specific Version to False, if its set to true…”

    • “Delete the C1.WPF.DX.4 dll from your project and re-add this dll from C’:\Program Files (x86)\ComponentOne\WPF Edition\bin\v4’ location.”

      "

    If still the issue persists, please refer the following article discussing on how to resolve this issue:

    https://www.grapecity.com/en/blogs/a-step-ahead-troubleshooting-common-errors-part-i

    Thanks & regards,

    Ruchir Agarwal

  • Posted 31 October 2018, 10:12 pm EST

    Hi,

    Thanks for your response on this.

    We have never referenced C1.WPF.DX.4 dll on our project before and it used to work fine. However, I tried to add a latest version (FileName=C1.WPF.DX.4, Version=4.0.20172.566) of this binary into the project and the problem persists.

    All the binaries are added with the property ‘Specific Version’ to False.

    Please do let us know if you can suggest anything. Thanks

  • Posted 1 November 2018, 8:17 pm EST

    Hello,

    Thank you for sharing your observations.

    As per the exception, to build your project Visual Studio needs “4.0.20171.549” version of C1.WPF.DX.4, whereas you are trying to add version “4.0.20172.566”. So, could you please check what is the version of dlls present at C:\Program Files (x86)\ComponentOne\WPF Edition\bin\v4 location. If the version at this location is 4.0.20172.566 then probably some assembly in your project is/are still referencing the older version. If there are any such dlls in your project, could you please replace them with the corresponding ones from the above location.

    Ideally, all dlls in a VS project should be of same version and this version should match the version of dlls present at C:\Program Files (x86)\ComponentOne\WPF Edition\bin\v4.

    However, if still the issue persists would it be possible for you to share a demo application showing the issue?

    Also, I attached a sample that uses C1PdfDocument and works fine (without C1.WPF.DX.4 dll) with both 4.0.20172.549 and 4.0.20172.566 versions. Could you please try to run the sample and see if the issue occurs?

    Thanks,

    Ruchir

    PdfCreator.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels