Getting Project Root Path In Controller ASP.NET MVC?

C#asp.netasp.net MvcPath

C# Problem Overview


I am using dotlesscss for my css and I remember how to use that but what I am forgetting is how to get the root project path so that I can generate the full file path to my .less file to get for the less engine to parse. How do I get the project root path so that I can generate the path for my less files?

C# Solutions


Solution 1 - C#

Server.MapPath("~");

or:

HostingEnvironment.ApplicationPhysicalPath 

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionryanzecView Question on Stackoverflow
Solution 1 - C#Darin DimitrovView Answer on Stackoverflow