Showing posts with label ASP.NET MVC. Show all posts
Showing posts with label ASP.NET MVC. Show all posts

Saturday, March 1, 2014

For checking which .NET Framework is installed in your PC, follow the below steps

Steps:
  1. Click on Start.
  2. Type regedit in  Search and files area.
  3. You will see Registry Editor popup window.
  4. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework.
You will see different version which are already installed.
Check the latest version installed in your PC. :)



Sunday, February 23, 2014

My first post :)

This is a common exception that happens when we upgrade an installed package. So why is this throwing this exception.

FileLoad Exception
Could not load file or assembly 'BLToolkit.4, Version=4.1.10.2158, Culture=neutral, PublicKeyToken=b1d3f6ab3aadaca3' or one of its dependencies. 
The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)


I got this exception when I tried to upgrade to BLToolkit version 4.1.21. In order to get a detailed description for this exception there is a handy tool Fuslogvw.exe (Fusion Log Viewer /Assembly Binding Log Viewer) which is automatically installed with Visual Studio and with the Windows SDK. The Assembly Binding Log Viewer displays details for assembly binds that Visual Studio fails to bind at runtime.

To enable Fusion Log viewer

If you have Visual Studio installed on your computer: On the taskbar, click Start, click All Programs, click Visual Studio, click Visual Studio Tools, right-click Visual Studio Command Prompt, and then click Run as administrator from the shortcut menu.

At the administrator command prompt, type

fuslogvw

http://msdn.microsoft.com/en-us/library/e74a18c4%28v=vs.110%29.aspx

Assembly Binding Log Viewer- Figure 1

Add the following registry values to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion

DWORD ForceLog set value to 1
DWORD LogFailures set value to 1
DWORD LogResourceBinds set value to 1
String LogPath set value to D:\FusionLogs\ (optional)

Make sure to include the backslash after the folder name. You can also give custom folder path in Log Location in the popup window.
After configuring and verifying the Log Viewer is enabled; start the application in visual studio debug mode.
You will get list of all assemblies loading for that application in the Log Viewer. Select the assembly having conflict issues and click on View Log button in the popup.

Listing both versions - Figure 2
Two version of assembly is loaded, select the application and click on View Log. It will open in a new browser window with detailed description of error.

LOG: Assembly Name is: BLToolkit.4, Version=4.1.21.0, Culture=neutral, PublicKeyToken=b1d3f6ab3aadaca3
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
ERR: The assembly reference did not match the assembly definition found.
ERR: Setup failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.


Solution

Since after upgrade, the application is trying to load previous version which is not available in the assembly path. So we need to redirect the binding from previous version to newly updated version number.
Add the below code to your web.config.

   
   
   


In Figure 2 it is listing both the versions. After updating web.config, run the log viewer, you will see only the latest version of the BLToolkit package.