Created
June 22, 2021 04:49
-
-
Save corespider/ddf16ac9663e2a06828275f7cb0fbd15 to your computer and use it in GitHub Desktop.
Server.MapPath not working in ASP.Net Core
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HomeController : Controller | |
{ | |
private IHostingEnvironment Environment; | |
public HomeController(IHostingEnvironment _environment) | |
{ | |
Environment = _environment; | |
} | |
public IActionResult Index() | |
{ | |
string wwwPath = this.Environment.WebRootPath; | |
string contentPath = this.Environment.ContentRootPath; | |
return View(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment