0

I'm trying to package my wpf application as a single executable. I use Fody Costura which works fine packaging all the dll into the exe. However the exe still requires the application config file and it has to be in the same folder as the exe

So for instance if my application executeable is "myapp.exe" then the configuration file "myapp.config.exe" is required.

Can I package (embed the app config) such that only myapp.exe is required to run my application?

developer7788
  • 389
  • 1
  • 2
  • 15
  • how are your going to edit .config if it is packaged? on the other hand, if you don't edit config, you don't need that file at all – ASh Oct 23 '18 at 08:08
  • I don't need to edit it. Currently it contains some settings like the DbProviderFactories – developer7788 Oct 23 '18 at 08:33

1 Answers1

0

Can I package (embed the app config) such that only myapp.exe is required to run my application?

No, an application configuration file cannot be embedded into an assembly. At least not if you intend to use the App.config file as usual, using for example the ConfigurationManager class.

You could remove the configuration file but if you are storing some settings in it, you will need to move these to somewhere else and also implement your application to retrieve them from there.

mm8
  • 163,881
  • 10
  • 57
  • 88