Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update of Visual Studio (17.6.2) and SDK (6.0.302) prevents the use of source generators for Microsoft.Toolkit.MVVM #26542

Closed
MarcoSpoenemann opened this issue Jul 13, 2022 · 4 comments
Labels
untriaged Request triage from a team member

Comments

@MarcoSpoenemann
Copy link

Describe the bug

After installing the updates, it is no longer possible to compile WPF projects using Microsoft.Toolkit.MVVM. Errors are thrown during the build process:

  • The type already contains a definition for .
  • Duplicate 'global::System.CodeDom.Compiler.GeneratedCode' attribute

and so on.

It looks like code generators are executed twice.

To Reproduce

Use the sample project in this repository with Visual Studio 17.2.6 and the latest .NET 6 SDK and try to build: https://github.com/MarcoSpoenemann/dotnet6-mvvm

Exceptions (if any)

  • CS0101
  • CS0579
  • CS0102

Further technical details

.NET SDK (gemäß "global.json"):
Version: 6.0.302
Commit: c857713

Laufzeitumgebung:
OS Name: Windows
OS Version: 10.0.22000
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.302\

global.json file:
Not found

Host:
Version: 6.0.7
Architecture: x64
Commit: 0ec02c8c96

.NET SDKs installed:
2.2.402 [C:\Program Files\dotnet\sdk]
3.1.421 [C:\Program Files\dotnet\sdk]
5.0.102 [C:\Program Files\dotnet\sdk]
5.0.403 [C:\Program Files\dotnet\sdk]
5.0.408 [C:\Program Files\dotnet\sdk]
6.0.100 [C:\Program Files\dotnet\sdk]
6.0.107 [C:\Program Files\dotnet\sdk]
6.0.202 [C:\Program Files\dotnet\sdk]
6.0.203 [C:\Program Files\dotnet\sdk]
6.0.302 [C:\Program Files\dotnet\sdk]

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Jul 13, 2022
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@Tum4ik
Copy link

Tum4ik commented Jul 13, 2022

A workaround is here dotnet/wpf#6792.

@Keboo
Copy link
Member

Keboo commented Jul 13, 2022

Running into a similar problem on Material Desing in XAML Toolkit. It uses some source generators from XAMLTest which appear to be getting executed twice (or the output included twice). Rolling back the SDK with the global.json appears to fix the issue for now.

@marcpopMSFT
Copy link
Member

This is the issue tracking the fix. dotnet/wpf#6792

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

4 participants