dotnet / dotnet/arcade

Arcade forcing .config files to be generated for DLLs targeting net472

Open
#9,305 7 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
C#
Stars
729
Forks
397
Avg merge
3d 15m
Merged PRs (30d)
149

Description

Consider this part of `WorkAround.targets`

```xml




true


```

This effectively forces `$(GenerateBindingRedirectsOutputType)` to `true` whenever `$(AutoGenerateBindingRedirects)` is `true`. MSBuild though made a change that defaults `$(AutoGenerateBindingRedirects)` to `true` whenever a project targets `net472` or a later .NET Framework TFM. Together this means that when using arcade and targeting modern .NET Framework TFM it is generating app.config files even though that is likely not the intent of the author.

If you want to get a sense of the confusion this can cause consumers as well as MSBuild team members you can look at the following internal conversation

https://teams.microsoft.com/l/message/19:3212bf033f4c4b5198643a04fa1048fa@thread.skype/1652138528354?tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47&groupId=4ba7372f-2799-4677-89f0-7a1aaea3706c&parentMessageId=1652138528354&teamName=.NET%20Developer%20Experience&channelName=MSBuild&createdTime=1652138528354

Contributor guide

Open the contributing guide

Research direction

Start with the ForceGenerationOfBindingRedirects target in WorkAround.targets and inspect how it interacts with MSBuild's defaults for net472 and later .NET Framework TFMs. Reproduce a build for a DLL targeting net472, then verify whether an app.config is generated unexpectedly and define the desired behavior before changing the target.

Written by the indexing model from the issue text.

Assessment

Tech stack
xml
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.