Skip to content
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

Tools: Current Directory is wrong for .NET Core projects #7588

Closed
bricelam opened this issue Feb 10, 2017 · 1 comment
Closed

Tools: Current Directory is wrong for .NET Core projects #7588

bricelam opened this issue Feb 10, 2017 · 1 comment
Assignees
Labels
breaking-change closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@bricelam
Copy link
Contributor

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.

@bricelam
Copy link
Contributor Author

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.

@rowanmiller rowanmiller added this to the 2.0.0 milestone Feb 14, 2017
@ajcvickers ajcvickers modified the milestones: 2.0.0-preview1, 2.0.0 Apr 19, 2017
@bricelam bricelam modified the milestones: 2.0.0, 2.0.0-preview1 Apr 24, 2017
@bricelam bricelam removed the tools label Apr 26, 2017
@bricelam bricelam added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Apr 27, 2017
@divega divega added closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. and removed closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. labels May 10, 2017
@ajcvickers ajcvickers modified the milestones: 2.0.0-preview1, 2.0.0 Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

4 participants