microsoft-ui-xaml: Cannot build F# project with Microsoft.ProjectReunion.WinUI

Describe the bug F# project that references Microsoft.ProjectReunion.WinUI does not build

C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2902,7): error MSB4057: The target "XamlPreCompile" does not exist in the project.

Steps to reproduce the bug

  1. Clone https://github.com/xperiandri/Elmish.Uno/tree/uno_winui
  2. Check out https://github.com/xperiandri/Elmish.Uno/tree/uno_winui branch
  3. Open Elmish.Uno.sln
  4. Comment out my work around in Elmish.Uno.fsproj if it present (empty XamlPreCompile target)
  5. Build Elmish.Uno.fsproj

Expected behavior F# project builds successfully

Version Info Microsoft.ProjectReunion.WinUI 0.5.0-prerelease

NuGet package version: 0.5.0-prerelease

Windows 10 version Saw the problem?
Insider Build (xxxxx)
May 2020 Update (19041) Yes
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 19 (6 by maintainers)

Most upvoted comments

thanks @xperiandri - this helped me with an F# maui project also

image So, finally F# works! 🥳🥳🥳

There is nothing here related to cswinrt, looks like a WinUI issue.

@xperiandri - I updated the following and rebuilt with same error.

<PackageReference Include="Microsoft.ProjectReunion" Version="0.5.0" Condition="$(TargetFramework.StartsWith('net5.0-windows10'))" />
<PackageReference Include="Microsoft.ProjectReunion.Foundation" Version="0.5.0" Condition="$(TargetFramework.StartsWith('net5.0-windows10'))" />
<PackageReference Include="Microsoft.ProjectReunion.WinUI" Version="0.5.0" Condition="$(TargetFramework.StartsWith('net5.0-windows10'))" />