c# - 外壳文件错误 : missing assembly reference?

标签 c# wpf windows-api-code-pack

我找不到 ShellFile 的命名空间。

我添加了 using System.Windows.Shell 并尝试通过包管理器控制台加载 Windows7APICodePack:

PM> install-Package Windows7APICodePack

Installing 'Windows7APICodePack 1.0.0.0'.

You are downloading Windows7APICodePack from Microsoft, the license agreement to which is available at http://code.msdn.microsoft.com/WindowsAPICodePack/Project/License.aspx. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.

Successfully installed 'Windows7APICodePack 1.0.0.0'.

Adding 'Windows7APICodePack 1.0.0.0' to CADBuilderGUI.

Successfully added 'Windows7APICodePack 1.0.0.0' to CADBuilderGUI.

我刚刚尝试安装更高版本的 1.1.0.0:

PM> Install-Package Windows7APICodePack-Shell

但仍然没有运气。

我只是想获取文件的缩略图:

ShellFile shellFile = ShellFile.FromFilePath(files[0]);
Bitmap shellThumb = shellFile.Thumbnail.ExtraLargeBitmap;

但它不知道 ShellFile 是什么。

有什么建议吗?


This is not a duplicate of this because PresentationFramework.dll is added by reference and I am building in Framework 4.0.

最佳答案

PM> 安装包 WindowsAPICodePack-Core

PM> 安装包 WindowsAPICodePack-Shell

安装这两个就可以了。

关于c# - 外壳文件错误 : missing assembly reference?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24129691/

相关文章:

c# - 如何从exe中找出目标框架名称和版本?

c# - 将贝塞尔曲线段或线的端点绑定(bind)到 WPF 中的其他形状?

c# - 为什么在控制台应用程序中使用 CommonOpenFileDialog 时会出现此异常?

c# - 发布到 Azure - 找不到 MDF 文件

c# - 实时优化传感器数据,通过省略条目来减少日志文件的大小

wpf - 单击按钮时将填充设置为 LinearGradientBrush

c# - 如何在 TabControl 模板中使用自定义 TabItem?

c# - Windows 8 备份/恢复应用程序

c# - 如何在托管的资源管理器浏览器控件中获取大缩略图?

c# - Msdn风格地址URL本地化可能实现