aspnetcore: View not found running on .Net6 rc1
Describe the bug
After upgrading to .Net 6 rc1 a “View not found exception started to appear”
3.1.406 (Microsoft.AspNetCore.App 3.1.18) -> ok 5.0.400 (Microsoft.AspNetCore.App 5.0.9) -> ok 6.0.100-preview.7.21379.14 (Microsoft.AspNetCore.App 6.0.0-preview.7.21378.6) -> ok 6.0.100-rc.1.21417.9 (Microsoft.NETCore.App 6.0.0-rc.1.21415.6) -> exception
It’s an F# project with razor views. Views are each set to “Content”, do not copy.
I heard there were changes to Razor compiler. Do I need to fix something in my project files or maybe in Sdk.Razor.CurrentVersion.props?
Exception text:
Caught exception in ExceptionHandlerMiddleware System.AggregateException: Oneor more errors occurred. (One or more errors occurred. (The view ‘~/Views/Login.cshtml’ was not found. The following locations were searched:~/Views/Login.cshtml)) —> System.AggregateException: One or more errors occurred. (The view ‘~/Views/Login.cshtml’ was not found. The following locations were searched:~/Views/Login.cshtml) —> System.InvalidOperationException: The view ‘~/Views/Login.cshtml’ was not found. The following locations were searched: ~/Views/Login.cshtml at Microsoft.AspNetCore.Mvc.ViewEngines.ViewEngineResult.EnsureSuccessful(IEnumerable`1 originalLocations) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result) at Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeResultAsync>g__Logged|22_0(ResourceInvoker invoker, ActionResult result) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeNextResultFilterAsync>g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilter s() — End of stack trace from previous location — at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceEx ecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next,Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) — End of inner exception stack trace — — End of inner exception stack trace —.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 28 (11 by maintainers)
Updating to the rc1 / rc2 version of the RuntimeCompilation package fixes the issue.