After upgrade to 6.0.2 my start page throws 404?
See original GitHub issueHey!
After I’ve upgraded Piranha to 6.0.2 my Start page (“/start”) request fails to resolve to a website, but 404 content is thrown instead. I have upgraded and made code adjustments, but my local environment targets old database (if that is of any relevance). My Startup code isn’t heavily modified, nor isn’t “StartPage”. What might affect this issue is that my DB has multiple pages of type “StartPage” (did that for my own convenience for some reason 😃 )
` public void Configure(IApplicationBuilder app, IHostingEnvironment env, IServiceProvider services, IApi api) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); }
// Initialize Piranha
App.Init(api);
// Configure cache level
App.CacheLevel = Piranha.Cache.CacheLevel.Basic;
// Build content types
var pageTypeBuilder = new Piranha.AttributeBuilder.PageTypeBuilder(api)
.AddType(typeof(Models.BlogArchive))
.AddType(typeof(Models.StandardPage))
.AddType(typeof(Models.StartPage));
pageTypeBuilder.Build()
.DeleteOrphans();
var postTypeBuilder = new Piranha.AttributeBuilder.PostTypeBuilder(api)
.AddType(typeof(Models.BlogPost));
postTypeBuilder.Build()
.DeleteOrphans();
// Register middleware
app.UseStaticFiles();
app.UseAuthentication();
app.UsePiranha();
app.UsePiranhaManager();
app.UseHttpsRedirection();
app.UseMvc(routes =>`
Any ideas how to troubleshoot it properly would be so welcome, I’m pretty novice when it comes to ASP.NET apps
Thanks!
Alex Pawlak
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (3 by maintainers)
Top GitHub Comments
I’ve upgraded the official PiranhaCMS.org and all templates without issues so it has to be something else. Have you changed .net core runtime version or added any other middleware into the pipeline?
Sorted out!
You said you upgraded templates just fine, so I started looking at my items one by one and it turned out I didn’t use a “template” you upgraded, but used the “MVCWeb” one available in Examples (not in the templates):
https://github.com/PiranhaCMS/piranha.core/blob/d969847abf2c487f90b2ab78ecc818a825f6c1fb/examples/MvcWeb/Controllers/CmsController.cs
I’ve replaced the CmsController file with actual template and it worked just fine 😃 https://github.com/PiranhaCMS/piranha.core.templates/blob/master/web/mvc/Controllers/CmsController.cs
I think I’ll review and cherry pick other files as well, are these new templates hosted somewhere so I can do a live lookup what they do?