Monday, February 14, 2011

Assembly Binding Tag

If you face assembly version mismatch problem then you will get "Could not load file or assembly" exception. There could be two solutions
1. Recompile the source code
2. If you dont have source code you can add a simple assemblyBinding tag under configuration in your web.config/app.config

For example I am using NHibernate.Validator dll which depends on NHibernate and was build with older version of NHibernate "". But in my project I have newer NHibernate version "". So i am getting the below exception

Could not load file or assembly 'NHibernate, Version=, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' or one of its dependencies

To resolve this issue all i have to do is to add the below assemblyBinding configuration

More can be find at

No comments:

Post a Comment