doc/articles/uno-build-error-codes.md
This error code means that a project has determined what both Uno.WinUI and Uno.UI packages are referenced.
To fix this issue, you may be explicitly referencing Uno.UI and Uno.WinUI in your csproj, or you may be referencing a NuGet package that is incompatible with your current project's configuration.
For instance, if your project references Uno.WinUI, and you try to reference SkiaSharp.View.Uno, you will get this error. To fix it, you'll need to reference SkiaSharp.View.Uno.WinUI instead.
This error code means that a WinAppSDK project is referencing a project in your solution which is not providing a net7.0-windows10.xx TargetFramework.
This can happen if a project contains only a net7.0 TargetFramework and has a NuGet reference to Uno.WinUI.
To fix this, it is best to start from a Cross Platform Library project template provided by the Uno Platform visual studio extension, or using dotnet new.
This error may occur during resources (.resw) analysis if the framework does not recognize the specified language code.
For instance, the language code zh-CN is not recognized and zh-Hans should be used instead.
The build process has determined that an MSBuild property was defined to override UnoVersion. This property is defined by the Uno.Sdk and cannot be changed and must be updated through the global.json file
Follow this guide in order to update the Uno Platform packages.
The build process has determined that the version of the Uno.WinUI NuGet package does not match the Uno.Sdk version. In general, restarting your IDE and compiling again will fix this issue.
Follow this guide in order to update the Uno Platform packages.
The build process has determined that you have specified an UnoFeature that requires a version to be set for a Package group such as Uno.Extensions, Uno.Toolkit.WinUI, Uno Themes, or C# Markup. Update your csproj file or Directory.Build.props with the property specified in the error along with the version that you would like to pin your build to.
The build process has detected that you have set the value UnoGenerateAotProfile to true for a build configuration that has not optimized the assembly (i.e. Debug build Configuration). You should only generate an AOT profile from a build Configuration that will optimize the assembly such as the Release build Configuration.
Building a net8.0-windows10.x.x class library using dotnet build is not supported at this time because of a Windows App SDK issue, when the library contains XAML files.
To work around this, use msbuild /r on Windows. You can build using msbuild with a Developer Command Prompt for VS 2022 (or 2026), or by using vswhere or using GitHub actions scripts in a CI environment.
This particular check can be disabled by setting the msbuild property UnoDisableValidateWinAppSDK3548 to true.
When Uno Implicit Package References are enabled you do not need to provide an explicit PackageReference for the Packages listed in the build message. You should open the csproj file, find and remove the <PackageReference Include="{Package name}" /> as listed in the build message.
Alternatively you may disable the Implicit Package References
<PropertyGroup>
<DisableImplicitUnoPackages>true</DisableImplicitUnoPackages>
</PropertyGroup>
In Visual Studio 2022/2026, an issue prevents debugging and Hot Reload from working properly for all targets when the net8.0-browserwasm TargetFramework is placed first in the TargetFrameworks property.
Make sure to place net8.0-browserwasm last in your <TargetFrameworks> property.
This warning can be disabled by adding the following to your .csproj:
<PropertyGroup>
<UnoDisableVSWarnBrowserNotFirst>true</UnoDisableVSWarnBrowserNotFirst>
</PropertyGroup>
In Visual Studio 2022/2026, an issue prevents other platforms debugging from working properly when the net8.0-desktop TargetFramework is placed first in the TargetFrameworks property.
Make sure to place net8.0-desktop first in your <TargetFrameworks> property.
This warning can be disabled by adding the following to your .csproj:
<PropertyGroup>
<UnoDisableVSWarnDesktopNotFirst>true</UnoDisableVSWarnDesktopNotFirst>
</PropertyGroup>
In Visual Studio 2022/2026, an issue prevents other platforms debugging from working properly when the net8.0-windows10.xxx TargetFramework is placed first in the TargetFrameworks property.
Make sure that net8.0-windows10.xxx is not first in your <TargetFrameworks> property.
This warning can be disabled by adding the following to your .csproj:
<PropertyGroup>
<UnoDisableVSWarnWindowsIsFirst>true</UnoDisableVSWarnWindowsIsFirst>
</PropertyGroup>
In Visual Studio 2022/2026, an issue prevents other platforms debugging from working properly when the net8.0 TargetFramework is placed first in the TargetFrameworks property.
Make sure that net8.0 is not first in your <TargetFrameworks> property.
This warning can be disabled by adding the following to your .csproj:
<PropertyGroup>
<UnoDisableVSWarnNetIsFirst>true</UnoDisableVSWarnNetIsFirst>
</PropertyGroup>
When building with Rider on Linux or macOS, unsupported target frameworks are not filtered automatically like other IDEs.
See how to make platforms conditional for Rider.
In Visual Studio 17.13 or earlier, when both mobile (-ios, -android) and desktop target frameworks are used, the -desktop target framework must be placed first in order for WSL debugging to work.
If -desktop is not first, the following message will appear:
The project doesn't know how to run the profile with name 'MyApp (Desktop WSL2)' and command 'WSL2'.
To fix the issue, reorder the items in your .csproj so that TargetFrameworks contains netX.0-desktop as the first target framework, or upgrade to Visual Studio 17.13 (when a stable release will be available).
The Uno Platform team is following this Visual Studio issue.
When publishing an app using ClickOnce on Windows, the PublishProfile file may not contain a PublishDir entry if the command line parameter UnoClickOncePublishDir has been set.
This situation is due to an MSBuild property overriding bug found in the .NET SDK. For more information, see our publishing with ClickOnce documentation.
When the SkiaRenderer feature is enabled, the Uno.WinUI.Runtime.WebAssembly and Uno.WinUI.WebAssembly packages must not be referenced directly.
This is generally a package authoring error, make sure to open an issue in the Uno Platform repository to report the problem.
On macOS code signing will fail if the project's output is located inside a directory that is backed up using iCloud. This is because iCloud adds some extended attributes to files and directories while codesign will refuse to sign such files.
ref: https://developer.apple.com/library/archive/qa/qa1940/_index.html
Solution: Move your Uno solution/project(s) to a different location, one that is not backed up by iCloud.
A member is not implemented, see this page for more details.
Do not call Dispose() on XXX
On iOS, calling Dispose() or Dispose(bool) on a type inheriting directly from UIKit.UIView can lead to unstable results. It is not needed to call Dispose as the runtime will do so automatically during garbage collection.
Invocations to Dispose can cause the application to crash in __NSObject_Disposer drain, causing ObjectDisposedException exception to be thrown. More information can be found in xamarin/xamarin-macios#19493.
Call 'InitializeComponent()' from code-behind
The method InitializeComponent should always be called in class constructor. A missing call will lead to hard-to-diagnose bugs. This analyzer reports when it's missing to make issues more apparent.
An assembly required for a component is missing
Some components like ProgressRing and MediaPlayerElement requires you to reference a specific NuGet package for them to work correctly.
ProgressRing, it requires Lottie dependency. For more information about adding Lottie to your project, see Lottie for Uno.MediaPlayerElement on WebAssembly or Gtk, it requires Uno.WinUI.MediaPlayer.WebAssembly or Uno.WinUI.MediaPlayer.Skia.Gtk NuGet package. For more information, see MediaPlayerElement.In Uno Platform 5.5, the EnableHotReload method has been deprecated and replaced by UseStudio().
Note that this change only applies to projects using the Uno.Sdk. If you're not using the Uno.Sdk, you can disable this warning using the following code:
#pragma warning disable UNO0008 // Replace with UseStudio() when migrating to the Uno.Sdk.
window.EnableHotReload();
#pragma warning restore UNO0008
The ProgressRing control needs an additional Lottie dependency to be enabled.
Building for the specified target framework is not supported on the current platform or architecture. For example:
Building WinUI applications requires the use of msbuild and the extension must be able to find it. This is done by using the vswhere utility.
Installing the latest stable Visual Studio release should provide both tools.
With version 0.14 (and later) you can override the location of msbuild.exe by:
Ctrl+,msbuildmsbuild.exe is located