Description
Description
In .net 7, we didn't need to use USER app
in the docker file.
Using the mount documented mount: $(AppData)/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro
The secrets.json would load for local development debugging.
In .net 8, we add USER app
.
Now, the secrets.json isn't loaded. When setting AddUserSecrets(optional: false) we see that get an exception:
System.IO.FileNotFoundException: 'The configuration file 'secrets.json' was not found and is not optional. The expected physical path was '/app/secrets.json'.'
at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload)
at Microsoft.Extensions.Configuration.ConfigurationManager.AddSource(IConfigurationSource source)
at Microsoft.Extensions.Configuration.ConfigurationManager.Microsoft.Extensions.Configuration.IConfigurationBuilder.Add(IConfigurationSource source)
at XXXXXX.Containers.Helpers.WebAppBuilderExtensions.ConfigureWebAppBuilder(WebApplicationBuilder builder, Boolean isInternal) in XXXXXXXX
If I comment out the USER app
line in my docker file, then it loads correctly.
What do I need to set the linux mount path to for this to work? Or does this need a change in the PathHelper?
Reproduction Steps
See above
Expected behavior
See above
Actual behavior
See above
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response