Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Add an Option to set the Razor view location formats #4550

Closed
@Eilon

Description

@Eilon

To customize the set of path formats that the Razor view engine will look at you need to customize the view engine itself. You need to either derive from RazorViewEngine, override the list of formats, and add that to the list of view engines, or you have to instantiate RazorViewEngine itself, set the list of formats, and add that to the list of view engines.

This is the property in question:

public virtual IEnumerable<string> ViewLocationFormats { get; } = new[]

(Plus the one for areas.)

We already have a Razor View Options class (https://github.com/aspnet/Mvc/blob/af58c2e6b619697a1a57736e9e996bb4d7e6e7ee/src/Microsoft.AspNetCore.Mvc.Razor/RazorViewEngineOptions.cs) so we should have the default list of view location formats there instead.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions