Migration to Csla4 RC1 almost complete, but now a strange runtime error

Migration to Csla4 RC1 almost complete, but now a strange runtime error

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


Jav posted on Wednesday, July 21, 2010

When I run my newly converted project from Csla3.8.4 to Csla4.0 RC1, I am getting this strange error (Notice the Csla3.8 references in error):

System.IO.FileLoadException: Could not load file or assembly 'Csla, Version=4.0.0.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, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)

   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)

   at System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)

   at System.Type.GetType(String typeName)

   at Csla.Reflection.MethodCaller.GetType(String typeName) in E:\MyDocuments\Visual Studio 2008\Projects\Csla3.8\Source\cslacs\Csla\Reflection\MethodCaller.cs:line 130

   at Csla.Serialization.Mobile.MobileFormatter.GetTypeFromCache(String typeName) in E:\MyDocuments\Visual Studio 2008\Projects\Csla3.8\Source\cslacs\Csla\Serialization\Mobile\MobileFormatter.cs:line 218

   at Csla.Serialization.Mobile.MobileFormatter.DeserializeAsDTO(List`1 deserialized) in E:\MyDocuments\Visual Studio 2008\Projects\Csla3.8\Source\cslacs\Csla\Serialization\Mobile\MobileFormatter.cs:line 289

   at Csla.Serialization.Mobile.MobileFormatter.Deserialize(Byte[] data) in E:\MyDocuments\Visual Studio 2008\Projects\Csla3.8\Source\cslacs\Csla\Serialization\Mobile\MobileFormatter.cs:line 428

   at Csla.Server.Hosts.Silverlight.WcfPortal.GetCriteria(Byte[] criteriaData) in E:\MyDocuments\Visual Studio 2008\Projects\Csla3.8\Source\cslacs\Csla\Server\Hosts\Silverlight\WcfPortal.cs:line 190

   at Csla.Server.Hosts.Silverlight.WcfPortal.Create(CriteriaRequest request) in E:\MyDocuments\Visual Studio 2008\Projects\Csla3.8\Source\cslacs\Csla\Server\Hosts\Silverlight\WcfPortal.cs:line 34

I have checked and rechecked all my references again and again, they appear to be okay.  I have walked through the code in the debugger.  There are a couple of BeginRefresh() calls from my ViewModels (I do not use any DataProviders).  When the code comes back to the FetchCompleted method in WcfProxy.cs, it jumps to the Catch block from the following very first line in the Try block:

   private void proxy_FetchCompleted(object sender, Csla.WcfPortal.FetchCompletedEventArgs e)
    {
      try
      {
        var response = ConvertResponse(e.Result);
        if (e.Error == null && response.ErrorData == null)
        {
         ...............................................
        }
      }
      catch (Exception ex)
      {
        OnFetchCompleted(new DataPortalResult<T>(default(T), ex, e.UserState));
      }
    }

I did not use the Csla Installer, resorting to the familiar old fashioned way.  I had 3.8.4 in Csla3.8 folder and installed the 4.0 RC1 in Csla4.0 folder.  I used 3.8.4 as I was bringing the project from VS08, SL3, .Net 3.5 to VS2010, SL4, .Net4.0  At that point I switched to Csla 4.0.  I have now removed the Csla3.8 folder completely and still get the errror.

Jav

Jav replied on Thursday, July 22, 2010

I discovered the reason for this error.  One of my ClientConfig files was pointing at the VS2008 website(ASP.Net 2.0.50727) instead of the proper website(ASP.Net4.0)
Now I have a different error, but I'm still working on it.

Jav

Copyright (c) Marimer LLC