opened
ciaran036
username_0
The error gets thrown when the Startup code runs for adding breadcrumbs: 

```
services.AddBreadcrumbs(GetType().Assembly, options =>
{
    options.OlClasses = "breadcrumb hidden-print";
});
```

I have a Razor page model which inherits an abstract type for implementing a user creation wizard: 

```
    [Breadcrumb("User")]
    public class CreateModel : WizardPageModel<UserWizardTransaction, IUserProcessor>
    {
        public CreateModel(IWizardService<UserWizardTransaction> wizardService, IUserProcessor processor) 
            : base(wizardService, processor)
        {
            
        }

        public override ActionResult Redirect(int? entityId)
        {
            return RedirectToAction("Detail", new { id = entityId })
                .SuccessToast($"User {MessageHandler.CreationSuccess}");
        }
    }
```

An excerpt from my abstract Razor Page model which exists in my Web.Models namespace: 

```
    public abstract class WizardPageModel<TWizardTransaction, TProcessor> : PageModel
        where TWizardTransaction : WizardTransaction
        where TProcessor : ITransactionProcessor
    {
        [BindProperty]
        public TWizardTransaction WizardTransaction { get; set; }

        public TProcessor Processor { get; set; }

        protected IWizardService<TWizardTransaction> WizardService { get; set; }

        public abstract ActionResult Redirect(int? entityId);

        protected WizardPageModel(IWizardService<TWizardTransaction> wizardService, TProcessor processor)
        {
            WizardService = wizardService;
            Processor = processor;
        }

        public IActionResult OnGet(Guid? transactionId, int? step)
        {
            WizardTransaction = WizardService.GetTransactions(transactionId, step);
            return Page();
        }

        public IActionResult OnPost()
        {
            var action = WizardTransaction.IsFinalStep() ? WizardAction.Finish : WizardAction.Next;
            return Save(action);
        }

        public IActionResult OnPostSave()
        {
            return Save(WizardAction.Save);
        }
    }
```

Any thoughts on why this might be throwing an exception? On a normal Razor page, adding the breadcrumb attribute works correctly. 

e.g. 

 ```
   [Breadcrumb("Settings")]
    public class IndexModel : PageModel
    {
        private readonly DataContext _dataContext;

        public SystemSettings SystemSettings { get; set; }

        public IndexModel(DataContext dataContext)
        {
            _dataContext = dataContext;
        }

        public void OnGet()
        {
            SystemSettings = _dataContext.Settings.Result;
        }

        public IActionResult OnPost()
        {
            if (ModelState.IsValid)
            {
                return RedirectToPage("Index").SuccessToast("Settings updated");
            }

            return Page();
        }
    }
```

Therefore, I'd have to assume the problem is something to do with my user create wizard inheriting the abstract WizardPageModel type? 

Thanks!
SmartBreadcrumbsException: The full name Web.CreateModel doesn't contain 'Pages'
issue
created
zHaytam
username_1
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".
comment
created
ciaran036
username_0
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. 

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!
comment
created
zHaytam
username_1
It personally never happened to me, that's weird.
I'm glad I was able to help!
comment
closed
zHaytam
username_1
issue
created
ciaran036
username_0
There was a bug in Visual Studio. Namespaces for Razor pages are now correct after updating Visual Studio 2019.
comment