-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 publish single file does not copy appsettings.json #3734
Comments
What type of app is this? Is it an ASP.NET, console, or something else? |
It's a console app. |
Could you please share the piece of the code which reads the configuration? I just tried with an ASP.NET web app and the configuration works just fine - it reads values from |
Apologies, it does indeed look like the appsettings.json is in the zipped temp location. |
The behavior of the bundler is to pack all files in the publish directory -- except PDBs and files explicitly annotated to be left out -- into the bundle. Please see: https://github.com/dotnet/designs/blob/master/accepted/single-file/design.md#build-system-interface So, for CC: @DamianEdwards |
That's perfect. Thanks mate |
New link for the design document: https://github.com/dotnet/designs/blob/master/accepted/2020/single-file/design.md#build-system-interface |
Steps to reproduce
When I try to run:
dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true
It gives me a single file exe however there is no appsettings.json file in sight.
How do I ensure that this file is copied across?
When I run the same command without the /p:PublishSingleFile=true switch then the appsettings.json file is included in the output directory.
Expected behavior
The /p:PublishSingleFile=true switch should ensure that the appsettings.json file is included as part of the publish.
Actual behavior
The appsettings.json file is not included in the output
Environment data
.NET core 3.0 preview 8
The text was updated successfully, but these errors were encountered: