Home > OS >  .Net core 3.1 winform not found .config after publish the project
.Net core 3.1 winform not found .config after publish the project

Time:10-05

I want to create only one .exe and .config file, so I publish the project and then select "single file". When it is completed, the publish folder only .exe and .pdb files. How to generate the .exe include all .dll and keep .config, because some folder path I want let the user to manual edit.

CodePudding user response:

Just run the following command in the project directory: dotnet publish -r win-x64 -c Release --self-contained and after that copy your <Application name>.exe.config file beside your exe. (They are not created/published by default, however if you create them manually beside your app, the configuration system respect to it.

  • Related