Reputation: 1469
How do you do the equivalent of Server.MapPath to find the path of a virtual directory with .Net Core?
Upvotes: 3
Views: 6190
Reputation: 3924
Path.Combine(Env.WebRootPath, "SomePath")
is the equivalent..
Env.WebRootPath
where Env = environment, usually from the startup.cs
edit
what about this...
ApplicationEnvironment env = new ApplicationEnvironment();
env.ApplicationBasePath;
there is a big thread about this on the asp.net core mvc on GitHub not sure if this is what you are looking for or not.
Upvotes: 1