-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explictily log working directory and let user know it will be used as content root path by default. #78789
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
We might be able to log this sooner, e.g. between It also should be easy to add this to your app by adding a |
One should know Content Root is affected by working directory to want it to be logged. ;-) |
Tagging subscribers to this area: @dotnet/area-extensions-configuration Issue DetailsIs there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.It's not the first time I making same mistake of starting published asp.net core application in docer without setting working directory:
And content root path becomes Host logs its content root path much later, so in case of failure I do not get a message like:
Describe the solution you'd likeIMO, if host logged current working directory it would be much friendlier to the developer:
Additional contextNo response
|
Tagging subscribers to this area: @dotnet/area-extensions-hosting Issue DetailsIs there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.It's not the first time I making same mistake of starting published asp.net core application in docer without setting working directory:
And content root path becomes Host logs its content root path much later, so in case of failure I do not get a message like:
Describe the solution you'd likeIMO, if host logged current working directory it would be much friendlier to the developer:
Additional contextNo response
|
I'm not sure what the design rationale was for making the ContentRoot default to the working directory? This breaks apps that depend on files that sit besides the app, like appsettings or Razor files. hostBuilder.UseContentRoot(AppContext.BaseDirectory) makes the problem disappear. Note: the content root can also be set using the |
@tmds , this should be in project template, IMO. |
@davidfowl do you know why Any thoughts on including: hostBuilder.UseContentRoot(AppContext.BaseDirectory) in the templates? |
The previous merge was reverted due to concerns in #85809 which need to be addressed for the next go. |
@steveharter the concerns varied from don't need this log at all to we can keep it with adjustments. So what is the target here ? In case we take the adjustment road, I'm not convinced at all with making the log level Debug, it's rare that someone launches an application with this min log level : from what I see in the community, we configure min log level as Information for Debug/Development environments and Warning/Error is used for integration/test/production environments. Downgrading to Debug means that no one will ever see it making it useless. |
The underlying issue is that ASP.NET apps that come with content files (like Razor pages and appsettings files), the files are published with the app, but the app goes looking for them in the working directory. |
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
It's not the first time I making same mistake of starting published asp.net core application in docker without setting working directory:
And content root path becomes
/
, soappsettings
and other content files are not found. This causes app to fail on startup.Host logs its content root path much later, so in case of failure I do not get a message like:
Describe the solution you'd like
IMO, if host logged current working directory it would be much friendlier to the developer:
Additional context
No response
The text was updated successfully, but these errors were encountered: