Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Harry Spyrou 212 posts 604 karma points
    Jun 21, 2022 @ 14:17
    Harry Spyrou
    0

    .NET 6 /U10 default configuration without Startup.cs does not allow /umbraco

    Hello,

    I've followed the installation procedure for Umbraco 10 and once Umbraco was installed, with dotnet new umbraco I decided to switch from Startup.cs to the new .NET 6 default configuration that includes only the Program.cs. Then, something weird started happening. Even though I could start it and see the website just fine, the /umbraco url stopped working and nothing I could do seemed to bring it back. Is the middleware firing when using this configuration?

    using MyProject.Core.Extensions;
    
    WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
    
    // Add services to the container.
    builder.Services.AddControllers();
    
    IWebHostEnvironment env = builder.Environment ?? throw new ArgumentNullException(nameof(builder.Environment));
    IConfiguration config = builder.Configuration ?? throw new ArgumentNullException(nameof(config));
    
    builder.Services.AddUmbraco(env, config)
        .AddBackOffice()
        .AddWebsite()
        .AddComposers()
        .AddCustomContentFinders()
        .SetContentLastChanceFinder<MyProject.Core.ContentFinders.Error404PageContentFinder>()
        .Build();
    
    WebApplication app = builder.Build();
    
    // Configure the HTTP request pipeline.
    app.UseUmbraco()
        .WithMiddleware(applicationBuilderContext =>
        {
            applicationBuilderContext.UseBackOffice();
            applicationBuilderContext.UseWebsite();
        })
        .WithEndpoints(endpointBuilderContext =>
        { 
            endpointBuilderContext.UseInstallerEndpoints();
            endpointBuilderContext.UseBackOfficeEndpoints();
            endpointBuilderContext.UseWebsiteEndpoints();
        });
    
    app.Run();
    

    It seems like the middleware is completely ignored or so it makes me think. Anyone ran into this?

  • Johan Runsten 38 posts 276 karma points c-trib
    Jun 22, 2022 @ 06:33
    Johan Runsten
    100

    Hi!

    I haven't tried this myself but there's an open issue from May regarding this: https://github.com/umbraco/Umbraco-CMS/issues/12445

  • Harry Spyrou 212 posts 604 karma points
    Jun 22, 2022 @ 08:09
    Harry Spyrou
    0

    Spot on, pretty sure that's what's happening! Thanks, I'll keep my eyes on the issues.

Please Sign in or register to post replies

Write your reply to:

Draft