4
votes

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.

2

2 Answers

7
votes

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.

1
votes

Add following dll to your project bin folder - DocumentFormat.OpenXml.dll (version 2)