Build WPF applications on macOS
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
* .NET Core Version: 3.1.403, 5.0.100-rc.1.20452.10, 5.0.100-rc.2.20479.15
* Windows version: Windows 10 2004 (OS Build 19041.572) ; macOS version: 11.0.1 Beta (20B5012d)
* Does the bug reproduce also in WPF for .NET Framework 4.8? Yes
**Problem description:**
I've a Mac and want to develop and build existing WPF application (.Net Core 3.1, 'WinExe') in macOS using Visual Studio for Mac and running it in Parallels (Windows) to test my implementations.
Building projects of type 'Library' works, but not for projects of type 'WinExe' (WPF).
**Actual behavior:**
When I build Libraries, building is successful. But building WinExe projects (WPF) always throws errors like these:
```
.../App.xaml(14,14): Error MC3074: The tag 'Application' does not exist in XML namespace 'https://schemas.microsoft.com/winfx/2006/xaml/presentation'. Line 1 Position 14. (MC3074)
```
This happens for all *.xaml files existing in that project. I know that **running** WPF applications on macOS isn't possible and I'm fine with that, but **developing** and **building** are not running the application in my opinion. I don't know if this issue is a bug or intentional.
**Expected behavior:**
Developing and Building should be possible like in Windows 10. Running the application though should result in an error message.
Update: To make it clear what I expect: In my opinion, it should be possible to build and run on all platforms without getting an error (maybe just a warning). Only if .NET recognize **on application startup** that it doesn't run on Windows, it should result in an error.
I would like to develop, build and click run on macOS. When clicking run, I would like Visual Studio (for Mac) to use Parallels Desktop (with installed Windows) which then will run the application. So my wish is to develop, build and debug in Visual Studio for Mac but running the application in my Parallels Desktop Windows system.
**Minimal repro:**
Create a .Net Core 3.1 project of type 'WinExe' (Executable with GUI). My App.xaml looks like this:
```
```
Contents of the .csproj file:
```
WinExe
netcoreapp3.1
win-x64
true
Debug [...]
x64
true
full
bin\x64\Debug\
x64
TRACE;DEBUG;DEV
latest
[...]
```
**Short hint**
I avoid following error
```
/usr/local/share/dotnet/sdk/5.0.100-rc.2.20479.15/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(63,5) : error NETSDK1100: Windows is required to build Windows desktop applications.
```
by using in csproj file:
```
```
Contributor guide
Assessment
This issue has not been assessed yet.