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.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-03-15 11:00:00 +0000
Seen: 10 times
Last updated: Sep 20 '22
If there are empty subfolders with identical names, can they be deleted?
How can I access the items within an empty list that is part of the input?
How can I incorporate Blazor Web Assembly into my current .Net Core 6 project through injection?
How do I create an index.html page for the js project in D3 JS?
Where can I find the location of the NuGet packages I have downloaded for my project?
How can ASP.NET be designed using a Bootstrap template?
How can I include a DLL in my Visual Studio project if the Browse option is unavailable?