Comments (8)
Can you catch that exception and capture ex.ToString()
, then post it here?
from cslaforum.
Csla.DataPortalException: Unable to read beyond the end of the stream.
at Csla.DataPortal`1.Fetch(Type objectType, Object criteria) in C:\\src\\rdl\\csla\\Source\\Csla.Shared\\DataPortalT.cs:line 408
at Csla.DataPortal`1.Fetch(Object[] criteria) in C:\\src\\rdl\\csla\\Source\\Csla.Shared\\DataPortalT.cs:line 398
at Csla.DataPortal.Fetch[T](Object[] criteria) in C:\\src\\rdl\\csla\\Source\\Csla.Shared\\DataPortal.cs:line 220
at Csla.DataPortal.Fetch[T]() in C:\\src\\rdl\\csla\\Source\\Csla.Shared\\DataPortal.cs:line 232
at NSERT.Library.PrinterList.GetPrinterList() in C:\\Users\\jchristian\\source\\repos\\NSERT\\NSERT\\NSERT.BusinessLibrary.Shared\\PrinterList.cs:line 41
------------------------------
System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
at System.IO.BinaryReader.ReadString()
at System.Security.Claims.Claim.Initialize(BinaryReader reader, ClaimsIdentity subject)
at System.Security.Claims.Claim..ctor(BinaryReader reader, ClaimsIdentity subject)
at System.Security.Claims.ClaimsIdentity.Initialize(BinaryReader reader)
at System.Security.Claims.ClaimsIdentity..ctor(BinaryReader reader)
at System.Security.Claims.ClaimsPrincipal.CreateClaimsIdentity(BinaryReader reader)
at System.Security.Claims.ClaimsPrincipal.Initialize(BinaryReader reader)
at System.Security.Claims.ClaimsPrincipal..ctor(BinaryReader reader)
at Csla.Serialization.Mobile.MobileFormatter.DeserializeAsDTO(List`1 deserialized) in C:\\src\\rdl\\csla\\Source\\Csla.Shared\\Serialization\\Mobile\\MobileFormatter.cs:line 265
at Csla.Serialization.Mobile.MobileFormatter.Deserialize(Stream serializationStream) in C:\\src\\rdl\\csla\\Source\\Csla.Shared\\Serialization\\Mobile\\MobileFormatter.cs:line 228
at Csla.Serialization.Mobile.MobileFormatter.Deserialize(Byte[] data) in C:\\src\\rdl\\csla\\Source\\Csla.Shared\\Serialization\\Mobile\\MobileFormatter.cs:line 403
at Csla.Server.Hosts.HttpPortal.<Fetch>d__1.MoveNext() in C:\\src\\rdl\\csla\\Source\\Csla.Web.Mvc.Shared\\Server\\Hosts\\HttpPortal.cs:line 117
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Csla.Server.Hosts.HttpPortalController.<CallPortal>d__6.MoveNext() in C:\\src\\rdl\\csla\\Source\\Csla.Web.Mvc.Shared\\Server\\Hosts\\HttpPortalController.cs:line 252
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Csla.Server.Hosts.HttpPortalController.<InvokePortal>d__5.MoveNext() in C:\\src\\rdl\\csla\\Source\\Csla.Web.Mvc.Shared\\Server\\Hosts\\HttpPortalController.cs:line 230
"
from cslaforum.
Also, what version of CSLA and what version of .NET an d what version of ASP.NET?
from cslaforum.
Sorry, I should have included that in the original post.
CSLA v5.1.0 (NuGet Packages)
.NET 4.7.2
If I understand how to read the ASP.NET version right, it is 4.0.30319.42000
Thanks!
from cslaforum.
Interesting. Version 5.1 includes code to wrap ClaimsPrincipal
for serialization.
So now I'm wondering what type is your principal and your identity? The serializer is clearly hitting some principal type that contains a ClaimsIdentity
, and so I'm thinking that the principal type is neither ClaimsPrincipal
nor CslaClaimsPrincipal
.
from cslaforum.
I have tried two methods with the same results. Initially, I used the PTIdentity and PTPricipal from ProjectTracker. I have also tried:
var identity = NSERT.Library.Security.PTIdentity.GetPTIdentity("admin", "admin");
var baseidentity = new ClaimsIdentity(identity.AuthenticationType);
baseidentity.AddClaim(new Claim(ClaimTypes.Name, identity.Name));
if (identity.Roles != null)
foreach (var item in identity.Roles)
baseidentity.AddClaim(new Claim(ClaimTypes.Role, item));
var principal = new System.Security.Claims.ClaimsPrincipal(baseidentity);
Csla.ApplicationContext.User = principal;
It is likely my lack of understanding of how claims work, but I am lost right now.
from cslaforum.
Try looking at the BlazorCslaAuthentication sample from my Blazor book. It has the most current authentication model for modern ASP.NET and CSLA.
Specifically the code in the Login page
from cslaforum.
Will do! Thank you.
James
from cslaforum.
Related Issues (20)
- Quick questions about Csla 5.xx HOT 2
- Rocky Lhotka and CSLA .NET AMA survey
- 2 Blazor Questions HOT 7
- Including DataPortalController in Blazor.Server HOT 4
- Add virtual to Parent HOT 1
- Blazor ViewModel additional functionality (3 questions) HOT 25
- CSLA version 5.2.0 prerelease 20042401
- Blazor ViewModel GraphMerger error on loading managed property HOT 7
- Live interactive discussion about CSLA .NET May 14, 2020 HOT 6
- ASP.NET Core - iOS Specific - Unable to read beyond the end of the stream HOT 7
- CSLA version 5.2.0 prerelease 20042901
- how to convert Csla.ApplicationContext.User to SLMPrincipal class ? HOT 2
- "Data binding" for rules HOT 3
- Dapper and Csla Helper Classes HOT 3
- CSLA 5.2.0-20050802 prerelease
- Require Dependency Injection HOT 7
- Blazor Server Side. Authorization not work when deploy on Azure WebSite with SignalR HOT 2
- Async call for CSLA 5.2.0-R20050802 HOT 2
- NEW FORUM LOCATION HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cslaforum.