-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add NETSDK1234 warning for macOS apps with .App or .Service suffix #51441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/10.0.2xx
Are you sure you want to change the base?
Add NETSDK1234 warning for macOS apps with .App or .Service suffix #51441
Conversation
Co-authored-by: baronfel <[email protected]>
| buildCommand | ||
| .Execute("/p:RuntimeIdentifier=osx-x64", "/p:NoWarn=NETSDK1234") | ||
| .Should() | ||
| .Pass() | ||
| .And.NotHaveStdOutContaining("NETSDK1234"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot the MSBuild logger is emitting the MSbuild commandline to stdout, which includes the NETSD1234 label. Reduce the verbosity ("--verbosity:minimal") for this command so that only diagnostics are emitted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added --verbosity:minimal to the test to prevent the MSBuild command line from being emitted to stdout, which was causing the string "NETSDK1234" to appear in the output as part of the command arguments. Fixed in d2fd9ca.
Co-authored-by: baronfel <[email protected]>
|
@copilot the test Microsoft.NET.Build.Tests.GivenThatWeWantToWarnAboutMacOSAppNames.It_does_not_warn_when_not_targeting_macOS is still failing because the new warning is being fired even with the NoWarn passed in. please investigate. |
I've investigated this test and it's passing locally for me. When I run the test or manually build with The target condition only fires when Could you provide more details about the failure you're seeing? Is this happening in CI, or can you reproduce it locally? If it's a CI failure, could you share the logs so I can see what's different from my local environment? |
Implementation complete for macOS app naming warning (NETSDK1234):
Verification Results:
✅ Warning fires when building .App suffix with osx-x64 RID
✅ Warning fires when building .Service suffix with osx-arm64 RID
✅ Warning does NOT fire with non-macOS RID (win-x64)
✅ Warning does NOT fire with normal app names
✅ Warning can be suppressed with CheckMacOSAppName=false property
✅ Warning can be suppressed with /p:NoWarn=NETSDK1234 (with --verbosity:minimal to prevent false positive)
✅ All 7 unit tests pass
✅ No security issues found by CodeQL
✅ Code formatting is correct
The warning message:
"NETSDK1234: The application name '{name}' ends with '{suffix}' which may prevent the application from running on macOS. Rename the application or set the AssemblyName property to a different value."
Original prompt
Fixes #51432
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.