Skip to content

Instantly share code, notes, and snippets.

@CoreProgramm
Created January 26, 2020 14:07
Show Gist options
  • Save CoreProgramm/ae8dc416fafbe695acdd2f62d34afeba to your computer and use it in GitHub Desktop.
Save CoreProgramm/ae8dc416fafbe695acdd2f62d34afeba to your computer and use it in GitHub Desktop.
public class HomeController : Controller
{
private readonly IHostingEnvironment _hostingEnv = null;
string AppBasePath = null;
string ContentRootPath = null;
public HomeController(IHostingEnvironment HostingEnv)
{
_hostingEnv = HostingEnv;
AppBasePath = _hostingEnv.WebRootPath; //path to wwwroot
ContentRootPath = _hostingEnv.ContentRootPath; //path to GetBasePath
}
public IActionResult Index()
{
return View();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment