简体   繁体   中英

DocumentFormat.OpenXml Nuget package have many dependencies like Microsoft.NetCore.Platforms

I'm doing some Ms excel automation in my app, however upon polling DocumentFormat.OpenXml Nuget package many dependencies were downloaded along with it such as:

  • Microsoft.NetCore.Platforms
  • Microsoft.Win32.Primitives
  • NetStandard.Library
  • System.AppContext
  • System.Collections
  • System.Collections.Concurrent
  • System.Console
  • System.Diagnosics.Debug
  • System.Net.Http
  • System.Net.Sockets

And many other in spite the the fact that I'm targeting .Net framework not .Net core or standard. in fact I don't need those extra references in my class library project. Why those dependencies were installed? and is their any method that allows download only the specified package without those dependencies?

Why those dependencies were installed? and is their any method that allows download only the specified package without those dependencies?

This is the issue about the nuget package itself. When you check the dependencies of the package on the nuget.org :

在此处输入图片说明

We could to know the package add wrong dependencies (.NET Standard 1.3) to the .net framework project.

I have ever reported the similar issue on the github.

To resolve this issue, you can use the version 2.7.2 instead of 2.8.1 or just remove those extra references.

Note: To solve this issue finally, we need to report this issue to the author and wait author update this package:

https://github.com/OfficeDev/Open-XML-SDK/issues

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM