Getting: Could not load file or assembly ‘Interop.Shell32’ or one of its dependencies after converting a project to .NET 4.0
It used to work fine in .NET3.5
I have my IIS 7 pool set to allow 32bit executables.
Just as before my projects are targeted as ‘Any CPU’
Has anyone ever faced this error before? I’m seeing different Could not load errors but none quite like this one.
=== Pre-bind state information ===
LOG: User = IIS APPPOOL\ASP.NET v4.0
LOG: DisplayName = Interop.Shell32
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Interop.Shell32 | Domain ID: 11
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/myproj_sc/Dev/Dev/Src/Roms/myproj.Roms.Web/
LOG: Initial PrivatePath = C:\myproj_sc\Dev\Dev\Src\Roms\myproj.Roms.Web\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\myproj_sc\Dev\Dev\Src\Roms\myproj.Roms.Web\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/myproj.roms.web/7469284e/a2a73c18/Interop.Shell32.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/myproj.roms.web/7469284e/a2a73c18/Interop.Shell32/Interop.Shell32.DLL.
LOG: Attempting download of new URL file:///C:/myproj_sc/Dev/Dev/Src/Roms/myproj.Roms.Web/bin/Interop.Shell32.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
Is it something I can set in my machine.config?
If you need Shell32 as a reference, then the easiest thing to do is probably just add it again.
What probably happened is that the Interop file was generated in the bin directory of the old project and this was cleared out on upgrade.
Removing and readding the reference should regenerate the interop file.