我找不到 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/