Skip to content

.Net6.0 Razor Class Library cannot find view. #46114

@doogdeb

Description

@doogdeb

We have updated our asp.net core webapp to .net6.0 from .net3.1. We've also gone through our razor class libraries to update those to .net6.0. The issue we now have is that a view in one RCL is referencing a view component which exists in another RCL, but can no longer find the view, and throws the error below. However, one of the paths it shows it searched for is the correct path. Interestingly, if you bring the project in as project reference instead of nuget package, it's able to find it. This looks to be a problem with how it's compiled.

InvalidOperationException: The view 'ManagementContext' was not found. The following locations were searched /Views/Shared/Components/ManagementContext/Default.cshtml etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.Needs: ReproIndicates that the team needs a repro project to continue the investigation on this issuearea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesuntriaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions