When I try to use the latest version of DocumentFormat.OpenXml with Spreadsheet Light I get the following exception.
I have trimmed my code down to this. The exception occurs when the SLDocument constructor is called.
using SpreadsheetLight;
var template = new SLDocument();
This is my project file.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DocumentFormat.OpenXml" Version="3.0.0" />
<PackageReference Include="SpreadsheetLight" Version="3.5.0" />
</ItemGroup>
</Project>
This works with DocumentFormat.OpenXml v2.20.0, but fails when it is upgraded.
it is the DocumentFormat.OpenXml version. Spreadsheet Light works whit >=2.11.3 i have found the DocumentFormat.OpenXml version 2.20.0 works best