Skip to content

View not found running on .Net6 rc1 #35452

@En3Tho

Description

@En3Tho

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.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.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.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.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 ---.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Status: Resolvedarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templates

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions