Can't ignore many iOS SDK warnings because they don't have warning codes
- Dominant language
- C#
- Stars
- 2.9k
- Forks
- 576
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 123
Description
### Steps to Reproduce
1. Create a project that uses the iOS SDK (such as any `dotnet new maui` project)
2. Build it on Windows
3. Even worse, set WarningsAsErrors for the build
### Expected Behavior
No warnings or errors.
### Actual Behavior
You get warnings such as `There is no available connection to the Mac. Task 'VerifyXcodeVersion' will not be executed.`
And worse, with WarningsAsErrors, that warning becomes an error that is un-ignorable.
### Environment
Latest Windows, VS2022, etc.
### Build Logs
Can share MSBuild binlog if needed. Here's the crux of it:
```
Target Name=_VerifyXcodeVersion Project=maui Space-Dash.csproj
VerifyXcodeVersion
Assembly = D:\agent\1\s\bin\dotnet\packs\Microsoft.iOS.Sdk\15.0.101-preview.10.166\tools\msbuild\iOS\..\iOS\Xamarin.iOS.Tasks.dll
Parameters
SessionId = a61f9594282a736859d08d810636b0c54c0cc56e28c090f61cff10915540b1f1
Errors
D:\agent\1\s\bin\dotnet\packs\Microsoft.iOS.Windows.Sdk\15.0.101-preview.10.166\tools\msbuild\iOS\Xamarin.Messaging.Apple.targets(31,3): There is no available connection to the Mac. Task 'VerifyXcodeVersion' will not be executed [D:\agent\1\templatesTest\maui Space-Dash\maui Space-Dash.csproj]
```

## My thoughts
This particular warning comes from here:
https://github.com/xamarin/xamarin-macios/blob/2972e1b715a11dd508023ea5bb71085d4dbf43ce/msbuild/Xamarin.iOS.Tasks/Tasks/VerifyXcodeVersion.cs#L23
And it seems that the various warning messages are _named_ as if they have warning codes, but when the MSBuild Log APIs are called, no warning code is passed in. The tasks always call this overload:
https://docs.microsoft.com/en-us/dotnet/api/microsoft.build.utilities.tasklogginghelper.logwarning?view=msbuild-16-netcore#Microsoft_Build_Utilities_TaskLoggingHelper_LogWarning_System_String_System_Object___
```c#
public void LogWarning (string message, params object[] messageArgs);
```
And I'm guessing that if they call this overload and pass in a `warningCode`, that would make the warning ignoreable:
```c#
public void LogWarning (string subcategory, string warningCode, string helpKeyword, string file, int lineNumber, int columnNumber, int endLineNumber, int endColumnNumber, string message, params object[] messageArgs);
```
And I'd be happy to send a PR to try to fix this in at least some cases.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.