Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Could not load file or assembly from Program files - W7

20 Jan 2010   #1

Windows 7
Could not load file or assembly from Program files - W7

I installed my .Net application in to the Program files on Windows 7 machine. It was working perfectly. One week later i installed(now i have changed my certificate file key and signed my application. So that all assembly public key token value is different now) my application. When i tried to run my application, it threw the error message. " Could not load file or assembly 'microsoft.practices.enterpriselibrary.common, Version=, Culture=neutral, PublicKeyToken=e7178be946f5d743' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference (Exception from HRESULT:0x80131040)

Then i look into 'Assembly Binding Log Viewer (Fuslogvw.exe)' . I found the following information

*** Assembly Binder Log Entry (1/13/2010 @ 12:39:24 PM) ***
The operation failed.
Bind result: hr = 0x80131040. No description available.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable C:\Program Files\MyApplication\MyApplication.exe
--- A detailed error log follows. 
=== Pre-bind state information ===
LOG: User = IN\kmanassyed
LOG: DisplayName = Microsoft.Practices.EnterpriseLibrary.Common, Version=, Culture=neutral, PublicKeyToken=e7178be946f5d743
LOG: Appbase = file:///C:/Program Files/MyApplication/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MyApplication.exe
Calling assembly : System.Configuration, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files\MyApplication\MyApplication.exe.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: Microsoft.Practices.EnterpriseLibrary.Common, Version=, Culture=neutral, PublicKeyToken=e7178be946f5d743
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files/MyApplication/Microsoft.Practices.EnterpriseLibrary.Common.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Program Files\MyApplication\Microsoft.Practices.EnterpriseLibrary.Common.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Microsoft.Practices.EnterpriseLibrary.Common, Version=, Culture=neutral, PublicKeyToken=89dbb42750bb6d3b
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
ERR: The assembly reference did not match the assembly definition found.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
It says mismatch in Public Key token. Then i later found , my first certificate key value (using which i installed the application very first) to sign my application was "e7178be946f5d743". But now the application signed with the certificate(.pfx) that has key "89dbb42750bb6d3b". CLR Still looks for that e7178be946f5d743 assmeblies. If i install my application that signed with e7178be946f5d743 assembly it works fine. I cant run the application that signed with different key.

I have to add some interesting points here,

* If i right click my application.exe and click 'Run as Administrator', It prompts UAC prompt and after click 'yes' it works fine(Though I am admin to the system).

*My application works fine, If I install the application to any other local folder other than Program files

*My application works fine, If i turn off UAC

*Other assemblies like caching , servicemanager etc dlls were binded correctly

*I searched my whole system. i couldnot find the Microsoft.Practices.EnterpriseLibrary.Common.dll with public key token e7178be946f5d743 anywhere.

Anybody Advice me Pls. Thanks to read.

My System SpecsSystem Spec
21 Jan 2010   #2

Windows 7

Hi guys. It has been fixed. :). I found Virtual Store folder in my local path. It has those old dll and files.
My System SpecsSystem Spec
21 Jan 2010   #3

Windows 7

But anybody know, How to protect the files to be written into Virtual store folder. Is there anyway? Please share some knowlege recording Virtual store in W7
My System SpecsSystem Spec


 Could not load file or assembly from Program files - W7

Thread Tools

Similar help and support threads
Thread Forum
A file editing routine in Win7 or a program to deal with bulk files
I used to see file editors back in the early days and never was able to handle them due to arcane help files, TMI and other problems associated with pedantry in lingo. Soon I will need to edit my HD of duplicates and no longer- needed items. Please don't mention the "ability" to hold down...
error-failed to load locale files from "Program Files\Western Digital\
failed to load locale files from "Program Files\Western Digital\WD Smartware\Locale" The menu box it's under is entitled " WDContextMenuHandler " I get this error when I just right click on any part of "my computer" everytime. the pc then goes blank on desktop while it says " windows...
BSOD Help and Support
Have admin rights but can't create new file in Program Files (x86)
I'm trying to solve a problem with the Aspell spell-checker for Notepad++ by using the steps described at this link... Notepad++: Aspell files - en.pws , en.prepl However, when I right-click inside that folder to create a new text file, the only option in the "New" context menu...
General Discussion
Program Files or Program Files (x86)-Where to place downloaded program
My computers are both running Win 7 64-bit. I am thoroughly confused when it comes to placing programs that I download into their proper folders: That is, program files (x86) vs program files. I have read stuff on this, but still confused. for the most part, even when a dl'd program suggests...
How do I edit a file in Program Files tree?
How do I edit a file in the ProgramFiles(x86) directory? There is a .xml configuration file which is supposed to be editable to configure the app the way I want it (that's why it's called configuration file, MS!). Here's the file tree: C:\Program Files (x86)\TeXnicCenter\packages\math.xml. I...
General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 06:40.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App