Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net 6 registering services syntax invalid #102

Open
stephen-jonesy opened this issue Jul 1, 2022 · 2 comments
Open

.Net 6 registering services syntax invalid #102

stephen-jonesy opened this issue Jul 1, 2022 · 2 comments

Comments

@stephen-jonesy
Copy link

stephen-jonesy commented Jul 1, 2022

Error: InvalidOperationException: Unable to resolve service for type 'SmartBreadcrumbs.BreadcrumbManager' while attempting to activate 'SmartBreadcrumbs.BreadcrumbTagHelper'.

Since .Net 6 has moved where dependency injects are registered (from startup to Program.cs), the syntax within the documentation is no longer valid.

Is there currently a valid solution for this?

@peterkhoury97
Copy link

peterkhoury97 commented Sep 10, 2022

builder.Services.AddBreadcrumbs(Assembly.GetExecutingAssembly(), options =>
{
options.TagName = "nav";
options.TagClasses = "";
options.OlClasses = "breadcrumb";
options.LiClasses = "breadcrumb-item";
options.ActiveLiClasses = "breadcrumb-item active";
});

this will help

@karenpayneoregon
Copy link

In .NET Core Razor Pages I get System.InvalidOperationException: 'Sequence contains no matching element'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants