JJ_Jason
JJ_Jason

Reputation: 369

Microsoft.WindowsAPICodePack.Shell Could not load file or assembly

When i try to run a project using this dll. i get the following error:

Could not load file or assembly 'Microsoft.WindowsAPICodePack.Shell, Version=1.0.0.0, Culture=neutral, PublicKeyToken=90ba9c70f846762e' or one of its dependencies. The system cannot find the file specified.

I've tried all possible combinations of these properties:

Project properties

Also tried re-adding the reference. There are two projects in the solution, the reference is in both (if that info is of any use).

It's a C#, .NET 4 project.

What is causing the error?

Upvotes: 8

Views: 8808

Answers (4)

Markus G
Markus G

Reputation: 11

I can't speak for JJ_Jason, but I believe I was receiving this error because I was using the wrong Microsoft.WindowsAPICodePack.Shell.

There are three:

1: Microsoft.WindowsAPICodePack.Shell, authored by Microsoft

2: Microsoft.WindowsAPICodePack.Shell, authored by Lischee

3: Microsoft-WindowsAPICodePack.Shell, authored by rpastric

I was receiving this error with the Lischee version of the package but when I switched over to the Microsoft version, the issue went away. I'm assuming Malior and BigOmar had the same issue but in reverse.

Upvotes: 1

user15290075
user15290075

Reputation: 11

I had the same problem and resolved it by setting the default folder path, like so:

CommonOpenFileDialog dialog = new CommonOpenFileDialog();
dialog.InitialDirectory = Directory.GetCurrentDirectory();

Upvotes: 1

Malior
Malior

Reputation: 1351

It's not actually a solution so solved the error. But I found an alternative package that works well:

enter image description here

Upvotes: 2

BigOmar
BigOmar

Reputation: 364

even MS package gives the same error, I did install this one https://github.com/contre/Windows-API-Code-Pack-1.1 and it worked perfectly

enter image description here

Upvotes: 5

Related Questions