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

dotnet run --project issue #34331

Open
grzfidler opened this issue Jul 29, 2023 · 1 comment
Open

dotnet run --project issue #34331

grzfidler opened this issue Jul 29, 2023 · 1 comment
Assignees
Labels
untriaged Request triage from a team member

Comments

@grzfidler
Copy link

Hi, same issue was created here dotnet/core#7861
but seems like the bug still exists.
I was trying to run some project on Azure agent directly and failed to load appsetting.json file.
When you run "dotnet run --project "$(Build.SourcesDirectory)/src/MyProject/MyProject.csproj" then WebApplicationBuilder will search for appsettings in $(Build.SourcesDirectory), not in projects directory nor in Debug or Release folder.
To fix it I had to set correct base path and add again appsettings.json.
builder.Configuration.SetBasePath(AppContext.BaseDirectory);
builder.Configuration.AddJsonFile("appsettings.json", true);

Can you fix it or maybe add parameter to allow for setting execition folder context.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Jul 29, 2023
@dotnet-issue-labeler
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

2 participants