We recently ran the csproj migration tool on our solution with 156 projects:
dotnet tool install --global Project2015To2017.Migrate2019.Tool
This worked very well although we had to do a few modifications. However it has caused a problem where switching between branches before and after the change causes problems with the assemblyinfo.
The error is:
Duplicate 'global::System.Runtime.Versioning.TargetFrameworkAttribute' attribute [PROJECTNAME]
I believe this is because the new format is putting an assemblyinfo.cs and the old style csproj is somehow picking this up? You can see this here where it takes issue with a file:
PROJECTNAMEe\obj\x64\Debug\.NETFramework,Version=v4.7.2.AssemblyAttributes.cs
This can be fixed by running:
1. Close Visual studio/Rider
2. git clean -xfd
3. Get-ChildItem . -Include obj, .vs -Recurse -force | Remove-Item -Recurse -Force
4. Rebuild solution
Now this works but it's irritating that we constantly have to remind ourselves to do this. Is there a way to modify our new csprojs to make it not do this?