uno: False-positive errors in XAML preview when Windows is not selected as target

Current behavior

  1. Created a page for tab navigation.
  2. Set Page Background as Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
  3. Encountering a compilation error on Wasm as

image

Expected behavior

It ought to work like on Windows Desktop.

How to reproduce it (as minimally and precisely as possible)

No response

Workaround

No response

Works on UWP/WinUI

Yes

Environment

Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia, Uno.UI.RemoteControl / Uno.WinUI.RemoteControl

NuGet package version(s)

    <ItemGroup>
      <PackageReference Include="DryIoc.dll" Version="4.8.8" />
      <PackageReference Include="LiveChartsCore.SkiaSharpView.Uno" Version="2.0.0-beta.220" />
      <PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
      <PackageReference Include="Microsoft.Windows.Compatibility" Version="6.0.0" />
      <PackageReference Include="Uno.Extensions.Logging.WebAssembly.Console" Version="1.3.0" />
      <PackageReference Include="Uno.WinUI.WebAssembly" Version="4.2.6" />
      <PackageReference Include="Uno.WinUI.RemoteControl" Version="4.2.6" Condition="'$(Configuration)'=='Debug'" />
      <PackageReference Include="Uno.Wasm.Bootstrap" Version="3.3.1" />
      <PackageReference Include="Uno.Wasm.Bootstrap.DevServer" Version="3.3.1" />
    </ItemGroup>

Affected platforms

WebAssembly

IDE

No response

IDE version

Version 17.2.0

Relevant plugins

No response

Anything else we need to know?

No response

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

@muhammet484 this selector, specifically: image

@muhammet484 this selector, specifically: image

I would like to address this issue a little more. Let’s say I’d like to build apps only for mobile platforms (Android/iOS) because I’m not interested in developing an app for other platforms. When I generate a new project from template using custom settings (just Android and iOS or just one of them as platforms), then this workaround doesn’t work, because i cannot select “Windows” nor “UWP” from the projects dropdown. Is there anything known I can do with this? Every issue I’ve found pointed me to selecting “Windows” from the dropdown menu, which works if I generate a project also targetting that platform.

image image

thanks it solved the problem.

@lotrasoft that’s correct, it’s a Visual Studio issue that we’ve working with Microsoft to improve. If you select the Windows project in the top left selector in the XAML editor, this error should go away.