Skip to content

Return false from ComWrappers.Try... methods#90553

Merged
jkotas merged 2 commits into
dotnet:mainfrom
jkotas:issue-90311
Aug 15, 2023
Merged

Return false from ComWrappers.Try... methods#90553
jkotas merged 2 commits into
dotnet:mainfrom
jkotas:issue-90311

Conversation

@jkotas

@jkotas jkotas commented Aug 14, 2023

Copy link
Copy Markdown
Member

Return false from ComWrappers.TryGetComInstance/TryGetObject instead of throwing PNSE. It saves callers from needing to protect against PNSE.

Fix #90311

Return false from ComWrappers.TryGetComInstance/TryGetObject instead of
throwing PNSE. It saves callers from needing to protect against PNSE.

Fix dotnet#90311
@ghost ghost assigned jkotas Aug 14, 2023
@ghost

ghost commented Aug 14, 2023

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/area-system-componentmodel
See info in area-owners.md if you want to be subscribed.

Issue Details

Return false from ComWrappers.TryGetComInstance/TryGetObject instead of throwing PNSE. It saves callers from needing to protect against PNSE.

Fix #90311

Author: jkotas
Assignees: -
Labels:

area-System.ComponentModel

Milestone: -

@jkotas

jkotas commented Aug 14, 2023

Copy link
Copy Markdown
Member Author

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@AaronRobinsonMSFT

Copy link
Copy Markdown
Member

@ericstj I prefer this approach if there are no concerns.

@ericstj

ericstj commented Aug 15, 2023

Copy link
Copy Markdown
Member

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.

@ericstj ericstj closed this Aug 15, 2023
@ericstj ericstj reopened this Aug 15, 2023
@ericstj

ericstj commented Aug 15, 2023

Copy link
Copy Markdown
Member

With this you might be able to remove

else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)

@JeremyKuhne

@jkotas

jkotas commented Aug 15, 2023

Copy link
Copy Markdown
Member Author

With this you might be able to remove

I agree. Removed.

@jkotas

jkotas commented Aug 15, 2023

Copy link
Copy Markdown
Member Author

With this you might be able to remove
I agree. Removed.

The platform analyzer is complaining about the unconditional TryGetComInstance call on mobile platforms. I am going to leave it as is.

@jkotas jkotas closed this Aug 15, 2023
@jkotas jkotas reopened this Aug 15, 2023
@steveharter steveharter self-requested a review August 15, 2023 13:56
@ericstj

ericstj commented Aug 15, 2023

Copy link
Copy Markdown
Member

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.

@ericstj

ericstj commented Aug 15, 2023

Copy link
Copy Markdown
Member

I filed one issue for a failing test, the other seems to be a timeout running System.Runtime.Tests on Mac (recurring issue with Macs).

There are two asserts on WASI - but those legs aren't currently blocking.

I think this is OK to merge @jkotas. After that let's trigger a backport to RC1.

@jkotas jkotas merged commit 762030c into dotnet:main Aug 15, 2023
@jkotas jkotas deleted the issue-90311 branch August 15, 2023 18:40
@jkotas

jkotas commented Aug 15, 2023

Copy link
Copy Markdown
Member Author

/backport to release/8.0-rc1

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/8.0-rc1: https://github.com/dotnet/runtime/actions/runs/5870547092

@jkotas

jkotas commented Aug 15, 2023

Copy link
Copy Markdown
Member Author

/backport to release/8.0

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/8.0: https://github.com/dotnet/runtime/actions/runs/5871431638

@ghost ghost locked as resolved and limited conversation to collaborators Sep 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PlatformNotSupportedException thrown for System.ComponentModel.TypeDescriptor.NodeFor

5 participants