zHaytam / SmartBreadcrumbs

A utility library for ASP.NET Core (both MVC and Razor Pages) websites to easily add and customize breadcrumbs.
https://blog.zhaytam.com/2018/06/24/asp-net-core-using-smartbreadcrumbs/
MIT License
161 stars 77 forks source link

Net 6.0 Error with new template with GetType() #96

Open maurobernal opened 2 years ago

maurobernal commented 2 years ago

En Net 5.0, en StartUp.cs

 public class Startup
    {
       ...
           public void ConfigureServices(IServiceCollection services)
        {
            services.AddBreadcrumbs(GetType().Assembly);
          }
}

En Net 6.0 in Program.cs

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddBreadcrumbs(GetType().Assembly);

var app = builder.Build();
app.Run();

I have this error with GetType():

An object reference is required for the non-static field, method, or property 'object.GetType()'