shad0wk shad0wk - 1 year ago 162
C# Question

Referencing Shell32.dll?

I don't have .NET 4.5 to unzip zip files, so I'm using

like this. But when I reference the dll like this:

csc.exe /r:"C:\Windows\System32\shell32.dll" ...

I get this error:

fatal error CS0009: Metadata file 'c:\Windows\System32\shell32.dll' could not be opened -- 'An attempt was made to load
a program with an incorrect format. '

War War
Answer Source

Possibly because you are trying to reference it like a .NET assembly.

I would try to include the assembly using the /lib: argument instead as per...

/lib:dir1[,dir2] Compiler option.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download