Failed to save a file using ExcelFile

0

Im using ExcelFile to edit a excel file, then saving it as a pdf file. Everything is working on ASP.Net, but when im using Blazor it didn't work. The error that i got is:

"Could not load file or assembly 'PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified."

I thought im missing "PresentationCore.dll" for the references, so i check at the ASP.Net project and using the same dll file, but still got error:

"Could not load file or assembly 'PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Reference assemblies should not be loaded for execution.  They can only be loaded in the Reflection-only loader context. (0x80131058)"

And then i try the "PresentationCore.dll" but with version 3.0, and still got error like this:

"Could not load type 'MS.Internal.SecurityCriticalDataForSet`1' from assembly 'WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'."

Thank you

c#
asp.net
blazor
asked on Stack Overflow Sep 4, 2020 by Eztyfoe

1 Answer

1

I'm not familiar with ExcelFile but looking at the two errors it would suggest it's a .NET Framework library. If this is the case it won't work with Blazor or ASP.NET Core.

Blazor and .NET Core only work with .NET Standard 2.x libraries (and .NET Core 2.x or 3.x in some cases)

You need to find an alternative

answered on Stack Overflow Sep 4, 2020 by Quango

User contributions licensed under CC BY-SA 3.0