question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scaffold Identity Blazor: NotSupportedException: Specified method is not supported. Microsoft.AspNetCore.Mvc.RazorPages.PageBase.EnsureRenderedBodyOrSections()

See original GitHub issue

I am experiencing a strange bug after scaffolding identity for a blazor project. After scaffolding all the items or really any of them, I get this error: **An unhandled exception occurred while processing the request.** _NotSupportedException: Specified method is not supported. Microsoft.AspNetCore.Mvc.RazorPages.PageBase.EnsureRenderedBodyOrSections()_ Stack Microsoft.AspNetCore.Mvc.RazorPages.PageBase.EnsureRenderedBodyOrSections() Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderLayoutAsync(ViewContext context, ViewBufferTextWriter bodyWriter) Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context) Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, string contentType, Nullable<int> statusCode) Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, string contentType, Nullable<int> statusCode) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|29_0<TFilter, TFilterAsync>(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext<TFilter, TFilterAsync>(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters() Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, object state, bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.MigrationsEndPointMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.Invoke(HttpContext httpContext) Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.Invoke(HttpContext httpContext) Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Hopefully that doesn’t look like gibberish. I really need this fixed and need to know how. I am new to blazor and the last five years of .net development so I don’t know how to fix this. Anyways, if I can get help on this for my project that would be great because currently I can’t do anything on the project unless this bug gets fixed.

Let me know what other source code you may need. I can show the repo to someone if they are willing to take a look at it.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
zackmorgscommented, Feb 5, 2020

Sure sorry if I wasn’t clear! Of those options, “I have a properly running Blazor app, and after scaffolding Identity UI it now fails” is most definitely the predicament I am in.

0reactions
HaoKcommented, Mar 18, 2020

Glad to see you resolved this

Read more comments on GitHub >

github_iconTop Results From Across the Web

NotSupportedException in Asp.NET Core MVC Razor ...
1 Answer 1 ... The reason the EnsureRenderedBodyOrSections method is being called is because you're returning a View() result from a Controller, ...
Read more >
Adding Scaffold Identity to an existing Blazor server project
I have added the ASP.NET Core Identity to my existing Blazor server project (ASP.NET Core 7). I have a couple of questions.
Read more >
Scaffold Identity in ASP.NET Core projects
In this article. Scaffold Identity into a Razor project without existing authorization; Scaffold Identity into a Razor project with ...
Read more >
Scaffolding failing for identity in blazor - Microsoft Q&A
When I try to add identity thru the cli cause the tooling is broken form the gui I get this error. I am...
Read more >
Why am I gettting Error "Specified Method is not supported" ...
I get the error in Android project and I have made the appropriate insert into the AndroidManifest.xml file. 0 votes
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found