Open chris-smith-zocdoc opened 3 years ago
Files in the obj folder should get excluded from the default globs by DefaultItemExcludes:
Why does that not work in your scenario?
I'm not 100% sure of the exact reproduction steps yet, trying to gather info from my other team members, but I believe its related to the conversion process (going from <Project ToolsVersion="12.0" .. >
to <Project Sdk="Microsoft.NET.Sdk">
) and switching git branches (so newer intermediate outputs are present with the older format, or vice versa)
As a work around I've been having people remove the obj
folder manually
Get-ChildItem -Path . -Name obj -Recurse | Remove-Item -Recurse
Describe the bug
Generated files like [TFM].AssemblyAttributes.cs (eg
.NETFramework,Version=v4.7.2.AssemblyAttributes.cs
) that reside in theobj
folder should be removed by the clean target. Since these files are not able to be cleaned, we're seeing build failures across our organization where they they are inadvertently picked up by the default *.cs globs. Other generated files like AssemblyInfo.cs are correctly deleted by the clean targetTo Reproduce
GenerateTargetFrameworkAttribute is true (default)
Exceptions (if any)
Typically manifests as Duplicate TargetFrameworkAttribute Attribute https://github.com/dotnet/sdk/issues/12297
Further technical details
msbuild /version 16.11.0.36601
We're in the process of converting our existing .net framework csproj files to the newer SDK style