wpfui icon indicating copy to clipboard operation
wpfui copied to clipboard

Use mvvm source generators

Open IvanDmitriev1 opened this issue 3 years ago • 7 comments

Use MVVM source generators.

  • [x] Update
  • [ ] Bugfix
  • [ ] Feature
  • [ ] Code style update (formatting, renaming)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [ ] Documentation content changes

IvanDmitriev1 avatar Jul 19 '22 06:07 IvanDmitriev1

Generators don't work in some versions of Visual Studio and WPF. I would wait until the patch is officially published.

dotnet/wpf#6792 dotnet/wpf#6793 image

pomianowski avatar Jul 19 '22 08:07 pomianowski

On my pc project builds.

IvanDmitriev1 avatar Jul 19 '22 08:07 IvanDmitriev1

On my pc project builds.

Good old - "Weird, it works for me"

pomianowski avatar Jul 19 '22 08:07 pomianowski

Perhaps this is due to the fact that I am using a preview version of visual studio.

IvanDmitriev1 avatar Jul 19 '22 08:07 IvanDmitriev1

Still in Known Issues https://github.com/dotnet/core/blob/main/release-notes/6.0/known-issues.md#issues-building-wpf-application-with-windows-desktop-607-and-608=

With workaround:

  • To enable build in Windows Desktop 6.0.7, navigate to the directory containing the Microsoft.WinFx.targets file ( C:\Program Files\dotnet\sdk\6.0.302\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets )
  • Add the following target in the file:
<Target Name="RemoveDuplicateAnalyzers" BeforeTargets="CoreCompile">
    <ItemGroup>
        <FilteredAnalyzer Include="@(Analyzer->Distinct())" />
        <Analyzer Remove="@(Analyzer)" />
        <Analyzer Include="@(FilteredAnalyzer)" />
    </ItemGroup>
</Target>

pomianowski avatar Jul 19 '22 08:07 pomianowski

Strange, with sdk 6.0.400-preview.22330.6, everything builds normally

IvanDmitriev1 avatar Jul 19 '22 08:07 IvanDmitriev1

I hope that the build errors will be fixed in sdk 6.0.400.

IvanDmitriev1 avatar Aug 06 '22 14:08 IvanDmitriev1