-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Return false from ComWrappers.Try... methods #90553
Conversation
Return false from ComWrappers.TryGetComInstance/TryGetObject instead of throwing PNSE. It saves callers from needing to protect against PNSE. Fix dotnet#90311
Tagging subscribers to this area: @dotnet/area-system-componentmodel Issue DetailsReturn false from ComWrappers.TryGetComInstance/TryGetObject instead of throwing PNSE. It saves callers from needing to protect against PNSE. Fix #90311
|
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
@ericstj I prefer this approach if there are no concerns. |
That's fine by me. I recall the same was discussed to avoid the Windows check in the original fix and folks didn't want to do it. |
With this you might be able to remove Line 1545 in 333c2c7
|
I agree. Removed. |
The platform analyzer is complaining about the unconditional TryGetComInstance call on mobile platforms. I am going to leave it as is. |
Yeah, we'd need to remove that annotation too. I suppose that might be a bit further than we'd want to go though. We'll make the APIs not throw, but they're still not "supporting" this scenario. |
/backport to release/8.0-rc1 |
Started backporting to release/8.0-rc1: https://github.com/dotnet/runtime/actions/runs/5870547092 |
/backport to release/8.0 |
Started backporting to release/8.0: https://github.com/dotnet/runtime/actions/runs/5871431638 |
Return false from ComWrappers.TryGetComInstance/TryGetObject instead of throwing PNSE. It saves callers from needing to protect against PNSE.
Fix #90311