dotnet / dotnet/maui

#if WINDOWS does not compile

Open
#8,382 13 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-single-project platform/windows s/triaged s/verified t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 14h
Merged PRs (30d)
296

Description

Description

When I select Windows Machine, the code does not compile.
Expected behavior: When Windows Machine is selected to run the MAUI App, Visual Studio compiles the app for Windows.

image

The issue is not fixed when selecting .net6.0-windows from the dropdown in the code editor (I thought it would be fixed).
IntelliSense syntax check passes but build error is still there and the application cannot be started.
Clean/Rebuild does not help. Deleting bin and obj folders and then rebuilding does not help.

image

Steps to Reproduce

MauiApp11.zip

Version with bug

6.0.400 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows 10

Did you find any workaround?

No response

Relevant log output

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open MauiApp11.zip in Visual Studio, select the Windows Machine target, and reproduce the build failure described for .NET 6.0-Windows. Start with the Visual Studio build output and compare it with the IntelliSense result; done means the MAUI app compiles and starts on Windows 10 without requiring a cleanup workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.