1 | initial version |
There are a few ways to prevent MSBuild from utilizing App.config in the .NET6 part of a multi-targeted project:
Rename App.config file: Renaming App.config to something else, like App.config.disabled, will prevent MSBuild from using it.
Ignore App.config: Add App.config to .gitignore or any other version control tool you use to ignore it. This will prevent MSBuild from using it during the build process.
Exclude App.config from the build: In the .csproj file, exclude App.config from the build process by adding the following line:
<None Update="App.config">
<ExcludeFromBuild>true</ExcludeFromBuild>
</None>
This will prevent MSBuild from using it during the build process.
<PropertyGroup>
<UseAppConfig>false</UseAppConfig>
</PropertyGroup>
This will set the UseAppConfig property to false, preventing MSBuild from using App.config during the build process.
Note that if you need to use the App.config file in the .NET6 part of your project, you should not use any of the above methods. Instead, ensure your App.config file is correctly configured for the .NET6 part of your project.