Open-XML-SDK icon indicating copy to clipboard operation
Open-XML-SDK copied to clipboard

Method not found w/ System.IO.Packaging version 7.0.0

Open FabioZumbi12 opened this issue 2 years ago • 3 comments

Describe the bug Having an error when using with System.IO.Packaging 7.0.0

System.MissingMethodException
  HResult=0x80131513
  Message=Método não encontrado: 'System.IO.Packaging.PackageProperties DocumentFormat.OpenXml.Packaging.OpenXmlPackage.get_PackageProperties()'.

Downgraded to System.IO.Packaging 6.0.0 and works as spected

Screenshots If applicable, add screenshots to help explain your problem.

To Reproduce On init the var

var wb = new XLWorkbook(file.InputStream);

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Observed behavior A clear and concise description of what you expected to happen.

Expected behavior Import the XLS from inputstream

Desktop (please complete the following information):

  • OS: W11
  • Office version: NA
  • .NET Target: .NET Framework 4.6.1
  • DocumentFormat.OpenXml Version: 2.20.0 w/ System.IO.Packaging 7.0.0

Additional context Add any other context about the problem here.

FabioZumbi12 avatar May 10 '23 18:05 FabioZumbi12

6.0->7.0 is a major change, so this kind of thing may happen.

FYI v3.0 of the SDK is under development and has a beta out on NuGet. That supports v7.0 of System.IO.Packaging

twsouthwick avatar May 12 '23 16:05 twsouthwick

Also, I see you're using .NET Framework - the System.IO.Packaging won't do anything there. Suprised that it's broken, though

On .NET Framework, the System.IO.Packaging library is purely a reference assembly that type forwards to the inbox WindowsBase. If you need functionality from System.IO.Packaging, you'll need to run on .NET 6+

v6.0.0 of System.IO.Packaging supports 4.6.1, but v7.0.0 looks like it only supports 4.6.2+

twsouthwick avatar May 12 '23 16:05 twsouthwick

Can you provide a sample of the error you're seeing?

twsouthwick avatar Jul 14 '23 00:07 twsouthwick