Class WebHostEnvironmentExtensions
Contains extension methods for the Microsoft.AspNetCore.Hosting.IWebHostEnvironment interface.
Inheritance
System.Object
Namespace: Umbraco.Extensions
Assembly: Umbraco.Web.Common.dll
Syntax
public static class WebHostEnvironmentExtensions
Methods
View SourceMapPathWebRoot(IWebHostEnvironment, String)
Maps a virtual path to a physical path to the application's web root
Declaration
public static string MapPathWebRoot(this IWebHostEnvironment webHostEnvironment, string path)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Hosting.IWebHostEnvironment | webHostEnvironment | |
System.String | path |
Returns
Type | Description |
---|---|
System.String |
Remarks
Depending on the runtime 'web root', this result can vary. For example in Net Framework the web root and the content root are the same, however in netcore the web root is /wwwroot therefore this will Map to a physical path within wwwroot.