-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templates
Description
Historically, I've been able to get my project root directory from Razor by using the following line:
RazorProjectFileSystem razorFileSystem = webApp.Services.GetRequiredService<RazorProjectFileSystem>();
Console.WriteLine(razorFileSystem.GetItem("/").PhysicalPath) // c:\path\to\project\rootBut, I see that RazorProjectFileSystem is being obsoleted along with Razor runtime compilation.
Is there another way to get the project root directory from Razor? I currently have a Razor page manager class in which it does everything it needs to do without me having to manually give it my project's root directory. Without razorFileSystem.GetItem("/").PhysicalPath, I will have to add another argument to my page manager class's constructor.
Metadata
Metadata
Assignees
Labels
area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesIncludes: MVC, Actions and Controllers, Localization, CORS, most templates