.NET 3.5.1中的DocumentFormat.OpenXml 2.5发出警告

DocumentFormat.OpenXml 2.5 in .NET 3.5.1 gives warnings

我已经决定使用.NET 3.5.1,但是当我通过nuget package控制台使用install package documentformat.openxml添加DocumentFormat.OpenXml 2.5时,我会收到很多警告:

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".

似乎DocumentFormat.OpenXml 2.5需要或正在使用.Net 4

我应该担心这些警告吗[并且坚持在我没有得到这些警告的地方使用.net 4.5]?

我想避免使用.net 4.5,因为它们需要安装管理员权限。


从Open XML SDK 2.5 for Microsoft Office下载页,SDK需要Microsoft.NET Framework 4.0版。

如果要使用Microsoft.NET Framework 3.5 SP1,则只能使用Open XML SDK 2.0。


将以下dll添加到项目bin文件夹中-DocumentFormat.OpenXml.dll(版本2)