Unable to read beyond the end of the stream. #3941
-
I'm migrating to Csla 7 and have the latest version setup 7.0.4. We call a command to log the user in, which works and I set and id and key as claims into the ClaimsIdentity. We also store a Session object (a csla ROB) into the local context. We then make a second call to refresh the login session (we have a readonlybase for the session data) since the user picks a point in an org hierarchy which affects their permissions. The call to this command works in local data portal mode, but in a remote configuration we get an error from Csla. The command just loads a new Session instance and returns it via a property, it doesn't do anything else. Also in the remote configuration, we never hit this command's Execute method, but the DataPortalController is returning a 200 response code. I'm not sure why its not hitting the execute. If I put the login code into another action method of the DataPortalController, everything is fine and both the login and session refresh commands execute, so I don't think its our code bombing anywhere. Below is the exception stack trace I get back on the client.
This is our client configuration, which is part of the Setup in an NUnit test fixture.
And this is our configuration on the remote side, which is an Asp.Net MVC/WebApi 5 project on .net 4.7.2.
Anyone have any ideas what might be the issue? I'm also having trouble getting the symbols for Csla to load, which might help me figure out what's going on in Csla. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I've never figured out how to get the CSLA symbols to load, so it isn't just you. It is an area where I'd sure welcome help! The ClaimsPrincipal type isn't serializable, so MobileFormatter has a special case that detects a ClaimsPrincipal and wraps it in a CslaClaimsPrincipal, which is serializable. Under the covers, the CslaClaimsPrincipal gets a byte[] from the actual ClaimsPrincipal, and that's what gets transferred over the wire. On the other side, it should be creating a new ClaimsPrincipal based on that byte[] data. Are you, by chance, still running on .NET Framework? It seems to me that there was once (and maybe still is) a bug in .NET Framework where ClaimsPrincipal couldn't deserialize itself from its own byte array. |
Beta Was this translation helpful? Give feedback.
-
I have a potential implementation for MobileFormatter - noted in this issue: #1877 |
Beta Was this translation helpful? Give feedback.
I've never figured out how to get the CSLA symbols to load, so it isn't just you. It is an area where I'd sure welcome help!
The ClaimsPrincipal type isn't serializable, so MobileFormatter has a special case that detects a ClaimsPrincipal and wraps it in a CslaClaimsPrincipal, which is serializable.
Under the covers, the CslaClaimsPrincipal gets a byte[] from the actual ClaimsPrincipal, and that's what gets transferred over the wire.
On the other side, it should be creating a new ClaimsPrincipal based on that byte[] data.
Are you, by chance, still running on .NET Framework? It seems to me that there was once (and maybe still is) a bug in .NET Framework where ClaimsPrincipal couldn't deser…