The type initializer for '#tLD.#GOw' threw an exception

Posted by: mmudham on 14 September 2018, 5:44 am EST

    • Post Options:
    • Link

    Posted 14 September 2018, 5:44 am EST

    I tried to convert the existing excel in Win-forms application to Xlsx format.

    Everything worked fine in local and when I made a build and ran in release mode its throwing up

    “The type initializer for ‘#tLD.#GOw’ threw an exception”

    Tried to add two dll(DocumentFormat.OpenXml.dll

    GrapeCity.ActiveReports.Export.Excel.v9.dll) to avoid this error.

    Still getting the same.

    how to include these refereneces in License.licx file?

  • Posted 16 September 2018, 6:12 pm EST

    Hello,

    Generally, this issue gets resolved after adding mention dll’s. Could you please share the sample with us so that I can replicate the issue at my end.

    Thanks,

  • Posted 17 September 2018, 12:26 am EST

    Does these dll entries need to be added in the license.licx?

  • Posted 17 September 2018, 12:31 am EST

    private GrapeCity.ActiveReports.Viewer.Win.Viewer viewer1;

    private GrapeCity.ActiveReports.Export.Excel.Section.XlsExport xlsExport1;

    if (_rpt != null)

    {

    xlsExport1.MultiSheet = false;

    xlsExport1.RemoveVerticalSpace = true;

    xlsExport1.FileFormat = GrapeCity.ActiveReports.Export.Excel.Section.FileFormat.Xlsx;

    xlsExport1.Export(viewer1.Document, fileName);

    }

    And to the project, I have added the two dlls(DocumentFormat.OpenXml.dll

    GrapeCity.ActiveReports.Export.Excel.v9.dll).

  • Posted 17 September 2018, 12:39 am EST

    Hello,

    Does these dll entries need to be added in the license.licx?

    No, You need to add only entries of “Section Report” and “WinVeiwer”

    There is no error in your code. However, could you please tell me the version of “DocumentFormat.OpenXml.dll”. Also, If possible could you please share the stripped down sample with us.

    Thanks,

  • Posted 17 September 2018, 12:52 am EST

    DocumentFormat.OpenXml.dll (version -2.0.5022.0)

    Everything is working fine in my local and when it is build and in release mode its throwing up the error 'The type initializer for ‘#tLD.#GOw

    I found some other stuff about OpenXmlStandard

    Upon adding code below, will that help to fix this?

    xlsExport1.OpenXmlStandard = GrapeCity.ActiveReports.Export.Excel.Section.OpenXmlStandard.Transitional;

  • Posted 17 September 2018, 1:42 am EST

    Is that the correct version of dll(DocumentFormat.OpenXml.dll) am using?

  • Posted 17 September 2018, 7:18 pm EST

    Hello,

    Upon adding code below, will that help to fix this?

    I think no. In my understanding, this will not help to resolve the above help.

    Is that the correct version of dll(DocumentFormat.OpenXml.dll) am using?

    Yes, the version of dll is correct.

    Could you please check the “Copy local” of both dll’s is set to “True” or not?

    Thanks,

Need extra support?

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

Learn More

Forum Channels