Description
In MAUI, Mac UI is accomplished through Catalyst (UIKit for macOS) rather than AppKit. As a side-effect, various internals claim to be iOS. For example, OperatingSystem.IsIOS() will return true on a Mac if the app is a Catalyst app.
If you try Process.Start() or Process.Kill(), you get a PlatformNotSupportedException(). I believe this is by mistake, as starting and killing a process should be possible in macOS (but it indeed isn't in iOS).
In short, I believe that line (and the equivalent for Kill()) should read:
if ((OperatingSystem.IsIOS() && !OperatingSystem.IsMacCatalyst()) || OperatingSystem.IsTvOS())
In addition, the annotation [UnsupportedOSPlatform("ios")] appears to be wrong, as it triggers a "unsupported on maccatalyst" warning.
Reproduction Steps
- Create a project targeting
net6.0-maccatalyst, e.g. from the MAUI template.
- In
MacCatalyst-specific code, call:
var p = System.Diagnostics.Process.Start("/bin/ls");
Expected behavior
No warning should appear, and the process should launch.
Actual behavior
A warning appears, and launching the process throws in StartCore().
Regression?
This is arguably a regression compared to the Xamarin/Mono toolchain, because it targeted Cocoa (AppKit), not Catalyst (UIKit), where this wasn't a problem.
Known Workarounds
No response
Configuration
dotnet --info output:
~> dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.100-rc.2.21505.57
Commit: ab39070116
Runtime Environment:
OS Name: Mac OS X
OS Version: 12.0
OS Platform: Darwin
RID: osx-x64
Base Path: /usr/local/share/dotnet/sdk/6.0.100-rc.2.21505.57/
Host (useful for support):
Version: 6.0.0-rc.2.21480.5
Commit: 6b11d64e7e
.NET SDKs installed:
5.0.402 [/usr/local/share/dotnet/sdk]
6.0.100-rc.2.21505.57 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.11 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-rc.1.21452.15 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-rc.2.21480.10 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.11 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-rc.1.21451.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-rc.2.21480.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Other information
No response
Description
In MAUI, Mac UI is accomplished through Catalyst (UIKit for macOS) rather than AppKit. As a side-effect, various internals claim to be iOS. For example,
OperatingSystem.IsIOS()will return true on a Mac if the app is a Catalyst app.If you try
Process.Start()orProcess.Kill(), you get aPlatformNotSupportedException(). I believe this is by mistake, as starting and killing a process should be possible in macOS (but it indeed isn't in iOS).In short, I believe that line (and the equivalent for
Kill()) should read:In addition, the annotation
[UnsupportedOSPlatform("ios")]appears to be wrong, as it triggers a "unsupported onmaccatalyst" warning.Reproduction Steps
net6.0-maccatalyst, e.g. from the MAUI template.MacCatalyst-specific code, call:Expected behavior
No warning should appear, and the process should launch.
Actual behavior
A warning appears, and launching the process throws in
StartCore().Regression?
This is arguably a regression compared to the Xamarin/Mono toolchain, because it targeted Cocoa (AppKit), not Catalyst (UIKit), where this wasn't a problem.
Known Workarounds
No response
Configuration
dotnet --infooutput:Other information
No response