Manager Throws Error in Debug, but fine Release Mode #1927
Unanswered
WebGeeksUnlimited
asked this question in
General
Replies: 1 comment
-
Found the issue, my better half (also a dev) changed the startup.cs to be able to capture 404 references. In the Configure method she commented out the app.UseDeveloperExceptionPage(); and added the two lines below it now commented out. When you sign into the Manager, while running as debug, SiteMap throws an error because it is null.
It seems it was invoking the _Layout.cshtml at site front end level, with just the UseDeveloperExceptionPage() it doesn't do that. Not sure I understand that part, but believe her goal was to capture 404 errors. Seems to all work find without debug or deployed with the added middleware. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Build 10.1.0
Something odd, in VS2022 (17.3) when I debug and sign into the Manager area, the main layout throws an error when the sitemap is null. In release mode, no error. If I run start without debug everything is fine.
The failing line is
@foreach (var item in (await WebApp.Site.Sitemap.ForUserAsync(User, Auth)).Where(i => !i.IsHidden))
where I find SiteMap is null, error thrown is;
System.NullReferenceException: 'Object reference not set to an instance of an object.'
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=Piranha.AspNetCore
StackTrace:
at PiranhaSecurityExtensions.d__2.MoveNext()
This suddenly started and can't figure out why and only if debugging.
Does the Manager back end normally call the Layout.cshtml at the site level?
Thoughts?
John
Beta Was this translation helpful? Give feedback.
All reactions