Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ShellFile Error: missing assembly reference?

I cannot find the namespace for ShellFile.

I have added using System.Windows.Shell and also tried loading the Windows7APICodePack through the package manager console:

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.

I just tried installing the later version 1.1.0.0 with:

PM> Install-Package Windows7APICodePack-Shell

but still no luck.

I am simply trying to get a thumbnail image of a file with:

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

But it doesn't know what ShellFile is.

Any suggestions?


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

like image 755
user2368363 Avatar asked Jun 09 '14 21:06

user2368363


People also ask

Are missing an assembly reference?

In order to resolve this error, they have to delete the current reference and re-add the reference.


1 Answers

PM> Install-Package WindowsAPICodePack-Core

PM> Install-Package WindowsAPICodePack-Shell

Install these two and it will work.

like image 88
cpmars Avatar answered Nov 11 '22 08:11

cpmars