Closed ciaran036 closed 4 years ago
The error happens because the full name of the type Web.CreateModel
doesn't contain the keyword Pages
. SmartBreadcrumbs assumes that all Razor Pages are available in a folder named Pages
.
Mind telling me why you changed their place? To see whether to remove this "requirement".
Hi, my files were in the wrong location but my namespaces were at the root 'Web' instead of 'Web.Pages.User' for example. My bad. Adjusting the namespace causes it to work correctly for any page.
It seems that when creating a Razor Page in Visual Studio the namespace defaults to the root instead of 'Web.Pages.MyType'. Does that happen for you? I noticed this previously and thought it was strange but never questioned it further.
Thanks for the help, much appreciated!
It personally never happened to me, that's weird. I'm glad I was able to help!
There was a bug in Visual Studio. Namespaces for Razor pages are now correct after updating Visual Studio 2019.
I'm using v3.1.1 of SmartBreadcrumbs.
Getting this error message:
The error gets thrown when the Startup code runs for adding breadcrumbs:
I have a Razor page model which inherits an abstract type for implementing a user creation wizard:
An excerpt from my abstract Razor Page model which exists in my Web.Models namespace:
Any thoughts on why this might be throwing an exception? On a normal Razor page, adding the breadcrumb attribute works correctly.
e.g.
Therefore, I'd have to assume the problem is something to do with my user create wizard inheriting the abstract WizardPageModel type?
Error stack trace:
Thanks!