Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DocumentFormat.OpenXml 2.5 in .NET 3.5.1 gives warnings

I have decided to use .NET 3.5.1 but when I add the DocumentFormat.OpenXml 2.5 throught the NuGet Package Console with Install-Package DocumentFormat.OpenXml I get a lot of warnings :

1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3258: The primary reference "DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=123, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the .NET Framework assembly "System.Data.SqlXml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=123" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework.

1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3258: The primary reference "DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=123, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the .NET Framework assembly "System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=123" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework.

1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=123, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=123" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v3.5". To resolve this problem, either remove the reference "DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=123, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".

1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3258: The primary reference "DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=123, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the .NET Framework assembly "Accessibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=123" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework.

1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=123, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=123" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v3.5". To resolve this problem, either remove the reference "DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=123, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=123".

It seems like DocumentFormat.OpenXml 2.5 needs or is using .Net 4.

Should I worry about these warnings [and stick to .net 4.5 where I don't get these warnings]?

I want to avoid .net 4.5 since they need admin rights to be installed.

like image 391
Albertus Avatar asked Feb 15 '23 12:02

Albertus


1 Answers

From the Open XML SDK 2.5 for Microsoft Office download page, the SDK requires the Microsoft .NET Framework version 4.0.

If you want to use the Microsoft .NET Framework version 3.5 SP1, you can use the Open XML SDK 2.0 only.

like image 52
Chris Avatar answered Mar 20 '23 15:03

Chris