This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I'm using LS Beta 4 in a WCF scenario. The client and server rest in the same computer, comunicating using pipes. But when I try to get one of the entities, I get the following error on the client side: "The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://schemas.mindscape.net.nz/LightSpeed/v4:FindResult. The InnerException message was 'The deserializer cannot load the type to deserialize because type 'System.Collections.Generic.List`1[[Mindscape.LightSpeed.Entity, Mindscape.LightSpeed, Version=4.0.342.16969, Culture=neutral, PublicKeyToken=360c8f37b466ebb2]]' could not be found in assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Check that the type being serialized has the same contract as the type being deserialized and the same assembly is used.'. Please see InnerException for more details." The entity itself is very simple: Id, 2 string fields, and 2 FKs. Nothing is eager loaded. The query on the server side is something like this: return this.UnitOfWork.Query<Analyte>().Where(s => s.Id == 1).FirstOrDefault(); In the server I have also the console logger active, and I see a ton of queries been performed. Our "unit of work wrapper" has four one line properties that return a single entity (like the one before). The queries are like this:
return this.UnitOfWork.FindById<Project>(1);
return this.UnitOfWork.Query<Site>().Where(s => s.Id == 1).FirstOrDefault();
return this.UnitOfWork.Query<Analyte>().Where(s => s.Id == 1).FirstOrDefault();
return this.UnitOfWork.FindById<AnalyteType>(1);
It seems like the server is executing the four queries no idea why (we are only calling the third one). I was also expecting both types of queries (FindById and Where(...).FirstOrDefault() to end the same way, but it doesn't seem to be the case. Any tips on what may be happening? Regards, Vicente |
|
|
Hi Vicente, Check that you are referencing the model and LightSpeed in a consistent fashion on both the client and the service as that is what the error seems to indicate is occuring. Failing that if you are able to send through a repro of this I can have a look into what is causing the issue for you. In terms of the number of queries, it is probably worth examining specific what the queries are doing to trace them back to calls at the service side. If you send a repro through I could also have a look into this.
Jeremy |
|
|
Thanks a lot Jeremy, I'm trying to build a repro but there's quite a lot of code so it's going to take a while to clean this. |
|
|
Hi Jeremy, I keep on trying to build the repro, but it seems the issue is pretty weird. I have the same code in the repro (a client console app and a server console app), and things work there fine. But then I try inside ArcGIS (as a plugin) and the client (that is interacting with a COM library) gives me that weird List<...> error. So it seems it's somehow related to hosting things in COM, but I have not been able to gather much more information so far. Does it give you any idea on what may be happening? Regards, Vicente |
|
|
Jeremy,
BTW - you can disregard this. We discovered the issue was actually related to an oddity in how our host was resolving assemblies. The assemblies were failing to load (though the exception was not related to that).
We're resolved now, and it appears to be working as expected. |
|