You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The tools explicitly set the current directory to the output directory (e.g. bin\Debug) to match the behavior of classic csproj. However, the .NET Core Console App and ASP.NET Core Web Application projects use the project directory.
They do this primarily to support this line in the templates: .UseContentRoot(Directory.GetCurrentDirectory()) This allows them to use the project directory during development and the publish directory when deployed.
This line is in Program.Main(), and the tools bypass it by injecting the correct context root into Startup. However, anything else that depends on the current directory (e.g. relative paths) will be wrong.
This also caused us to provide a special environment variable ADONET_DATA_DIR on .NET Core which could go away if we fix this.
The text was updated successfully, but these errors were encountered:
Note, this will probably introduce a breaking(?) change to SQLite where relative-pathed databases will be put in the project directory instead of the output directory, but this feels more right and we've had a lot of requests for/confusion around it.
The tools explicitly set the current directory to the output directory (e.g.
bin\Debug
) to match the behavior of classic csproj. However, the .NET Core Console App and ASP.NET Core Web Application projects use the project directory.They do this primarily to support this line in the templates:
.UseContentRoot(Directory.GetCurrentDirectory())
This allows them to use the project directory during development and the publish directory when deployed.This line is in
Program.Main()
, and the tools bypass it by injecting the correct context root intoStartup
. However, anything else that depends on the current directory (e.g. relative paths) will be wrong.This also caused us to provide a special environment variable
ADONET_DATA_DIR
on .NET Core which could go away if we fix this.The text was updated successfully, but these errors were encountered: