-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Publishing single file WPF application breaks if app.config is used #3875
Comments
Milestone 6, really? Then I think you need to go public and announce that single-file deployment isn't supported in WPF for .NET 5. |
@SamBent noticed that the configuration file has the wrong name, which should end in .exe.config, not .dll.config. Renaming the file in the publish directory should fix the crash. The WPF team is investigating a proper fix. Thanks. |
No, it actually doesn't help to rename the file. Tried that before publishing this bug. You see when you publish or build w/o single file, the file name is still *.dll.config, and it works with that name. |
@ryalanms any news on this? |
Adding IDC WPF: @vishalmsft @singhashish-wpf ... |
having the same problem here, once I publish with PublishSingleFile set to true, I can't read(or write) the setting from app.dll.config. |
If you publish a WPF application in .NET 5, and this application is using an App.config, the application crashes when the framework is trying to find this file, even though the file is part of the published output.
The following settings are configured in project:
And when publishing the project with

dotnet publish -c Release
, then the output looks good:Correct name of the config file is there.
However, when the app is trying to access any setting in this file with ConfigurationManager, the app crashes:
Attaching the super-simple example.
WpfNet5App.zip
The text was updated successfully, but these errors were encountered: