dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.71k stars 1.07k forks source link

SDK 6.0.301 -> 6.0.302 upgrade breaks our build #26557

Closed AArnott closed 2 years ago

AArnott commented 2 years ago

Describe the bug

The VS-Platform repo build broke when the .NET SDK version installed on local dev boxes went from 6.0.301 to 6.0.302 (which released yesterday). Some kind of breaking change was made in this version of the SDK.

To Reproduce

On a machine with 6.0.301 or 6.0.302 installed

git clone https://devdiv@dev.azure.com/devdiv/DevDiv/_git/_optimized/VS-Platform
cd VS-Platform
git checkout 359c6d2f1db9b1adc15b11262aaf74ac625af938
.\init -Feature Editor
msbuild /t:rebuild src\Editor\VisualStudio\Impl\EditorImpl.csproj /r

If 6.0.302 is present, you'll see a bunch of build errors around the CsWin32 source generator we use, such as:

C:\Users\andarno\source\repos\VS-Platform\src\Editor\VisualStudio\Impl\Microsoft.Windows.CsWin32\Microsoft.Windows.CsWin32.SourceGenerator\Windows.Win32.PInvoke.User32.g.cs(331,52): error CS0111: Type 'PInvoke' already defines a member called 'SetWindowPos' with the same parameter types [C:\Users\andarno\source\repos\VS-Platform\src\Editor\VisualStudio\Impl\EditorImpl_jqjdp0fp_wpftmp.csproj]

But with 6.0.300 or 6.0.301, the build succeeds.

Further technical details

VS 17.4 Preview 1 (32711.401.main) is installed and where the msbuild.exe used in the repro steps comes from.

chsienki commented 2 years ago

This is a dupe of https://github.com/dotnet/sdk/issues/26542 which is caused by https://github.com/dotnet/wpf/issues/6792 a workarounds are pinning the SDK or https://github.com/dotnet/wpf/pull/6680#issuecomment-1183552170

marcpopMSFT commented 2 years ago

This is the issue tracking the fix. https://github.com/dotnet/wpf/issues/6792

JochemPalmsens commented 2 years ago

@chsienki is it a dupe? I'm not using wpf or CommunityToolkit.MVVC but still go problems when upgrading to VS 17.2.6 yesterday. I made a dev community issue

To summerize that:

This cost me the better half of my working day yesterday, which was very inconvenient.

Note, I am developing w WinUI3 app, so maybe CommunityToolkit.WinUI.UI.Controls gave similar issue?

kipusoep commented 2 years ago

@JochemPalmsens yeah the root issue is the same. I was able to fix it using these instructions: https://github.com/dotnet/wpf/issues/6792#issuecomment-1183530305

AArnott commented 2 years ago

This did not get fixed in 6.0.303 or 6.0.400. Sorely disappointing given how broken source generators are by this regression and we waited a month for the fix and it didn't come. What's going on?

Dragnalith commented 2 years ago

I confirm I also experience this issue with 6.0.303, and I have just tried 6.0.400 which does not fix it on my side either. In our company we are stuck in 6.0.301

AArnott commented 2 years ago

This is expected to be fixed this month (second Tuesday) in 6.0.304 and 6.0.401.

AArnott commented 2 years ago

I just tried 6.0.401 today and it does appear to in fact fix the problem!