C1PrintDocument and C1DocumentViewer crashing

Posted by: przemyslaw.dekiel on 16 June 2020, 3:34 am EST

  • Posted 16 June 2020, 3:34 am EST

    Hi,

    when I'm trying to create new instances of both those classes,
    var viewer = new C1DocumentViewer();
    and
    var printDocument = new C1PrintDocument();

    my software crashes with following error:
    System.TypeLoadException
    HResult=0x80131522
    Message=Could not load type 'System.AppDomainManager' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
    Source=C1.WPF.C1Report.4
    StackTrace:
    at C1.Util.Licensing.ProviderInfo.IsMsIdeDomainManager()
    at C1.Util.Licensing.ProviderInfo.IsDesignTime(LicenseContext context)



    System.MissingMethodException
    HResult=0x80131513
    Message=Method not found: 'System.String System.AppDomainSetup.get_LicenseFile()'.
    Source=C1.WPF.C1Report.4
    StackTrace:
    at #AT.#eU.#6T(LicenseContext #8H, Type #db, Assembly #5T)
    at #AT.#eU.#4T(LicenseContext #8H, Type #db, Assembly #5T)


    The error seems to be suggesting a license issue, but I can't figure out what might be wrong with it. Here are the contents of my .licx file:
    C1.WPF.FlexGrid.C1FlexGrid, C1.WPF.FlexGrid.4
    C1.WPF.C1Report.C1DocumentViewer, C1.WPF.C1Report.4
    C1.C1Preview.C1PrintDocument, C1.WPF.C1Report.4

    Is it missing something? (It's worth mentioning, that flex grid controls aren't causing any problems).

    Thanks,
    Przemyslaw
  • Replied 17 June 2020, 4:29 am EST

    Hello,

    Thank you for sharing the exception message and stack trace. Are you using the WPF controls in a .Net Core type project? If not, would it be possible for you to share a small application showing the issue?

    I tried creating a simple WPF application and do not face any exception when creating instances of the said classes.

    Thanks,
    Ruchir
  • Replied 17 June 2020, 8:14 pm EST

    Hi Ruchir,

    thanks for your reply.
    Yes, it's a .Net Core project.

    Thanks,
    Przemyslaw
  • Marked as Answer

    Replied 18 June 2020, 6:00 pm EST

    Hello,

    Thank you for confirming the project type.
    Which ComponentOne version are you using? The support for .Net Core might not be available in older version of the components. So, I would suggest you to use the latest version 4.5.20201.416, as I can verify that using this version of the component
    there are no errors thrown with .NetCore 3.1 WPF project. Refer attached application.

    Thanks,
    Ruchir
    LicensesValidation_WPF.zip
  • Replied 16 July 2020, 1:14 am EST

    Hello Ruchir,

    thanks for your help so far.
    creating the instances of C1PrintDocument and C1DocumentViewer is no longer crashing (looks like the crash was caused by something else - sorry about that!), but they still cause a lot of exceptions before finally succeeding, which in turn causes a really long delay.

    a second problem is displaying a report preview - it's working fine if I add some items too it, for example RenderText, but opening a preview with a RenderImage inside is crashing the application as soon as the mouse is over the image on the preview (System.IO.IOException: 'Entries cannot be opened multiple times in Update mode.').

    Those issues are occurring with the C1.WPF.C1Report.4.dll I was originally using (version 4.0.20163.226), the one you recommended (4.0.20201.416 - I assume this is the one you meant, I didn't have version 4.5.20201.416 available), and the latest one (4.0.20202.438).

    Is there any solution for those problems?

    I modified your application to show you all those problems.

    Thanks,
    Przemyslaw
  • Replied 16 July 2020, 1:35 am EST

    Hi Ruchir,

    looks like I actually forgot to attach the project in the previous post! Sorry about that, here it is.

    Thanks,
    Przemyslaw
    LicensesValidation_WPF.zip
  • Replied 16 July 2020, 9:17 pm EST

    Hello,

    Running the application you shared, I could see the issue occurring at my end as well. Hence, I have forwarded it to the concerned team for fix [ID: 448504].
    I will update you as soon as there is some conclusion.

    Regards,
    Ruchir
  • Replied 23 July 2020, 3:21 pm EST

    Hello,

    The team was also able to replicate the problem. However, it is not ComponentOne related issue, instead it's a Microsoft issue in .NET Core that MS's DocumentViewer can't show xps files.
    We are attaching following few posts reported by MS customers for the same issue in .NET Core platform:
    https://github.com/dotnet/runtime/issues/39430
    https://github.com/dotnet/runtime/issues/24962
    https://github.com/dotnet/runtime/issues/27397
    So, I would suggest you to contact Microsoft for the issue.

    Thanks,
Need extra support?

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

Learn More

Forum Channels