# Troubleshooting setup and builds

Start with the exact command, SDK version, target framework, and first meaningful error. A long build log often ends with several consequences of one earlier failure.

## Verify the selected SDK

Run from the app folder:

```sh
dotnet --info
dotnet --list-sdks
dotnet workload list
```

Check whether a `global.json` selects an SDK different from the one you expected. Most Xui app projects target .NET 10. A template package, generated app, and runtime packages from different revisions can expose different APIs; do not patch generated C# until you have checked their versions.

## Narrow the build

Build one project and, for Mobile, one target framework:

```sh
dotnet build MyApp.Desktop.csproj -c Release
dotnet build MyApp.Mobile.csproj -f net10.0-android -c Release
```

Use the command appropriate to your host and installed tooling. If Desktop succeeds and Mobile fails, investigate workload, SDK/NDK/JDK, signing, or platform resources before changing a shared view.

For package restore failures, check configured sources, authentication, and package version availability. For a missing generated shader helper, confirm the CompileTime analyzer reference and read its diagnostics. For a missing native library, inspect packaging and runtime identifiers.

## Diagnose a blank launch

Check stderr and browser console output first. Verify that application startup creates and shows its main window. Confirm that the content has a nonzero arranged size. In the browser, inspect requests for `_framework` files and fonts, and test the deployed URL prefix.

If the app launches but only one view fails, replace its content with a label or the [Canvas fundamentals view](../../canvas/fundamentals/index.md). That separates host startup from the feature under investigation.

## Keep the reproduction useful

Record the project variant, OS, SDK, package versions, command, first error, and smallest failing source. Include expected and actual behavior. Do not erase every cache as a first step: it can hide the difference between stale output and a reproducible configuration error.

After fixing the issue, rerun the same command and the relevant focused test. A different target succeeding is useful evidence, but it does not close the original failure.
