Could not load file or assembly 'Csla, Version=4.0.1.0 when using 4.2.0

Could not load file or assembly 'Csla, Version=4.0.1.0 when using 4.2.0

Old forum URL: forums.lhotka.net/forums/t/10588.aspx


Jav posted on Wednesday, August 03, 2011

I started using Csla 4.2.0 for my SL project soon after it was released (around mid April).  Everything has been fine while developing and testing on the VS Development Server.  Prior to that I had installed and tested on Web Server without any issues. 
Today after a long hiatus I installed the project on a Web server and started getting my dreaded Server Not Found Error.  After many frustrating tries, I decided to backtrack using my backups to see where the error started.

It turns out that the last of my projects that installs fine and works on the Web without any problems is from April 6.  That one was using Csla 4.1.  I have now tested 4 subsequent projects spanning about a month, all of which are using Csla 4.2.0.  In each of those I get the following error:

System.IO.FileLoadException: Could not load file or assembly 'Csla, Version=4.0.1.0, Culture=neutral, PublicKeyToken=93be5fdc093e4c30' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) 
           at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
           at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)
          at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase
          at Csla.Reflection.MethodCaller.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
          at Csla.Serialization.Mobile.MobileFormatter.GetTypeFromCache(String typeName)
          at Csla.Serialization.Mobile.MobileFormatter.DeserializeAsDTO(List`1 deserialized)
          at Csla.Serialization.Mobile.MobileFormatter.Deserialize(Byte[] data)
          at Csla.Server.Hosts.Silverlight.WcfPortal.Create(CriteriaRequest request)

In each case, I have gone through every project and reset the references, ad nauseam.  The errors persist through early May.   Server Not found was not an issue then - It started appearing after that.

As I said, in my VS Deleopment Server, I must has run the project a thousand times in the past 3 months and have never seen the above error.  Server Not Found error will have to wait until I get this issue resolved.

Jav

vbbeta replied on Wednesday, August 10, 2011

You have to copy the the Referenced CSLA.DLL file from the you library project into the bin directory of the your exe project  

Copyright (c) Marimer LLC