Today I've started having this annoying issue while trying to run my web application.
The scenario is as follows:
I have a Web Application Project (WAP from now on) and 4 Library Projects (BusinessEntities, BusinessLogic, DataAccess and Utils).
DataAccess references BusinessEntities BusinessLogic references BusinessEntities and DataAccess The WAP references BusinessLogic, BusinessEntities and DataAccess
When I run the WAP I get:
System.TypeLoadException: Could not load type 'Namespace.DataAccess.ClassDataAccess' from assembly 'DataAccessAssembly', Version=1.0.3551.29465, Culture=neutral, PublicKeyToken=null'.
This is when a method from BusinessLogic tries to create an isntance of a DataAccess class. I use reflector on the DataAccess dll inside de bin folder of the WAP and it does contain the class I'm calling.
I've already tried deleting temporary asp.net file but without success, I'm using Cassini as web server (did not tried IIS yet)
Thanks.
You can also use a tool that comes with the SDK called fuslogvw.exe (Assembly Binding Log Viewer). It is useful for finding assembly binding errors and explains why the error occurred.
It's likely that you've got some mixed up version numbers in your references.
Check your project references, your web.config file and your .dll versions to make sure that all your references are correct.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With