Used Old 2017 Telerik Silverlight UI for Excel File Exporter - Fails with Cannot Load Assembly Error

0 Answers 74 Views
Spreadsheet
Winston
Top achievements
Rank 1
Winston asked on 10 Mar 2023, 05:53 PM

Hi Telerik,

I used the old Telerik Silverlight UI to create a simple *.exe file that creates an excel file.   The *.exe uses .NET framework 4 and references the below libraries from the 2017 Telerik Silverlight UI:

using Telerik.Windows.Documents.Spreadsheet;

using Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.xlsx;

This old *.exe no longer works when run on newer Windows 64-bit consoles with .NET 4.5 Framework installed.  The *.exe terminates with the below error stacktrace:

----------------------------

Could not load file or assembly 'System.Windows, Version=5.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.

   at Telerik.Windows.Documents.Spreadsheet.Model.Workbook..ctor()
   at OracleExcelExport.Program.ProcessConfigFile(String configFile) in C:\Users\183639\Documents\Visual Studio 2010\Projects\OracleExcelExport\OracleExcelExport\Program.cs:line 61
   at OracleExcelExport.Program.Main(String[] args) in C:\Users\183639\Documents\Visual Studio 2010\Projects\OracleExcelExport\OracleExcelExport\Program.cs:line 30

------------------------------

I am thinking it maybe 32-bit to 64-bit compatibility problem.  Either way, there is bad reference from Telerik.Windows.Documents.Spreadsheet.Workbook..ctor()

Let me know if you can help.

Nikolay Demirev
Telerik team
commented on 14 Mar 2023, 10:47 AM

Hi Winston,

Are you creating a .NET Core application, if so, the Silverlight assemblies are not compatible with it. The missing assembly, which is part of the Silverlight SDK, is required because there are some APIs in it that Document Processing is using. The issue can be caused because there is no Silverlight runtime or SDK installed. If you are creating .NET Core app, you can use the .NET Standard DPL assemblies.

Winston
Top achievements
Rank 1
commented on 14 Mar 2023, 12:58 PM

I am not creating a .NET Core application.  I did try recompile the .NET 4 Framework application from a x86 application to an x64 application due to an ODP.NET (64-bit) dependancy.

After recompiling, the application throws an error when it reaches the Telerik Document Processing.

Could not load file or assembly 'System.Windows, Version=5.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.

   at Telerik.Windows.Documents.Spreadsheet.Model.Workbook..ctor()

 

Winston
Top achievements
Rank 1
commented on 14 Mar 2023, 01:09 PM

Just checked.  Silverlight 5 SDK is installed.
Nikolay Demirev
Telerik team
commented on 14 Mar 2023, 02:46 PM

I have created a Silverlight project and tried to modify it to x64, but with no success. I am attaching the project here, could you modify it and send it back to me, so I can reproduce the issue? Also, please note that there is System.Windows with version 5.0.5.0 in the default project template for Silverlight projects.
Winston
Top achievements
Rank 1
commented on 14 Mar 2023, 04:07 PM

Thanks for the help.

I sort of biggy-backed the Silverlight Document library to generate an excel file (*.xlsx).  There is really no Silverlight project, so I can delete it.

Rather than spend the headache to make it work, I think it would be better simply to use another Excel library.  I am currently looking at below library:

Microsoft.Office.Interop.Excel

I just need to recode all the references and change any methods that differ.

Nikolay Demirev
Telerik team
commented on 15 Mar 2023, 12:06 PM

The DocumentProcessing libraries can run on all platforms .NET Framework runs and can be used with all .NET Framework project types. You just have to pick the correct flavor. There are several options:

  1. .NET Framework runs on all project types using the full .NET Framework but depends on some WPF assemblies.
  2. .NET Core - it can be used for WPF and WinForms .NET Core applications because, again depends on some WPF assemblies.
  3. .NET Standard can be used everywhere - mobile, web, mac OS, iOS, Android, Linux,...

Microsoft.Office.Interop.Excel requires having a licensed MS Office on the machines your software runs.

No answers yet. Maybe you can help?

Tags
Spreadsheet
Asked by
Winston
Top achievements
Rank 1
Share this question
or