I'm trying to use spreadsheetlight to write to excel file, but apparently spreadsheetlight uses XML 2.0 and I have 2.5 installed. I've unistalled the 2.5 version and have added the 2.0 reference to my project, but I still get an error message telling me that I'm using the 2.5 version. And my question is simply: how do I get the compiler (?) to use the 2.0 version rather than the 2.5 version?
Sincerely Axel
So the issue appears to be the Spreadsheetlight nuget package is missing a required dependency specification in the Nuspec.
Install-Package DocumentFormat.OpenXml -Version 1.0.0
If you have already installed DocumentFormat.OpenXml and are getting an exception similar to Could not load type ‘DocumentFormat.OpenXml.Spreadsheet.SmartTags’ from assembly ‘DocumentFormat.OpenXml, Version=2.5.5631.0
UNinstall-Package DocumentFormat.OpenXml
Check your config files, if you have an assembly binding redirect
<dependentAssembly>
<assemblyIdentity name="DocumentFormat.OpenXml" publicKeyToken="31bf3856ad364e35"... />
<bindingRedirect oldVersion="0.0.0.0-2.5.5631.0" newVersion="2.5.5631.0" />
</dependentAssembly>
Delete this.
Now install the specific version:
Install-Package DocumentFormat.OpenXml -Version 1.0.0
Source: EricTummers.com Get Spreadsheetlight working
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With