aspnet / live.asp.net

Code for live.asp.net, which hosts the ASP.NET Community Stand-up
https://live.asp.net/
MIT License
289 stars 114 forks source link

RC2 Program.cs Directory.GetCurrentDirectory() fails if run from different folder #84

Closed IRooc closed 8 years ago

IRooc commented 8 years ago

In the Main startup you use Directory.GetCurrentDirectory() to set the contentroot of the webserver, but this will fail if you start the application from a different folder like dotnet run -p src\live.asp.net

It would be better to use PlatformServices.Default.Application.ApplicationBasePath to always have the correct path right? It's in Microsoft.Extensions.PlatformAbstractions

DamianEdwards commented 8 years ago

This is the desired behavior and indeed what is in our default templates now. Apps are free to change the code to point to whatever they want, but this code is optimized for working with the project in VS, from the command line in the project root, and after the project is published.