#if WINDOWS does not compile
Nobody has claimed this yet.
- 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.

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.

Steps to Reproduce
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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