无法找到类型或命名空间“DocumentFormat” - 仅在构建时 - 但智能感知显示类型可用

tee*_*nup 3 .net c# vsto openxml openxml-sdk

Power Tools for Open XML我已经从以下网站下载了:-

https://powertools.codeplex.com/

我在 VS2012 中打开解决方案,然后更新引用 -DocumentFormat.OpenXmlWindowsBase.

问题是:-

当我开始在类顶部键入名称空间时,Visual Studio 智能感知会显示名称空间,但是当我构建解决方案时,我从使用此名称空间的所有类中收到以下错误 -

The type or namespace 'DocumentFormat' could not be found.

don*_*ack 5

也许其他人仍然面临问题,就像我一样。

转到 nuget 包管理器并搜索 openxml 并从那里安装。