Skip to content
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

PlatformNotSupportedException thrown for System.ComponentModel.TypeDescriptor.NodeFor #90311

Closed
steveharter opened this issue Aug 10, 2023 · 4 comments · Fixed by #90553
Closed
Assignees
Labels
area-System.Runtime.InteropServices blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' blocking-release Known Build Error Use this to report build issues in the .NET Helix tab regression-from-last-release runtime-mono specific to the Mono runtime
Milestone

Comments

@steveharter
Copy link
Member

steveharter commented Aug 10, 2023

Error when running /azp run runtime-extra-platforms
windows.10.amd64.android.open

Several errors like:

  Starting:    System.ComponentModel.TypeConverter.Tests (parallel test collections = on, max threads = 2)
    System.ComponentModel.Tests.PropertyDescriptorTests.PropertyDescriptorCanBeCreatedThatAccessesNonPublicPropertyOnAssociatedDesigner [FAIL]
      System.PlatformNotSupportedException : Operation is not supported on this platform.
      Stack Trace:
        /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs(1545,0): at System.ComponentModel.TypeDescriptor.NodeFor(Object instance, Boolean createDelegator)
        /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs(1509,0): at System.ComponentModel.TypeDescriptor.NodeFor(Object instance)
        /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs(892,0): at System.ComponentModel.TypeDescriptor.GetDescriptor(Object component, Boolean noCustomTypeDesc)
        /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs(1299,0): at System.ComponentModel.TypeDescriptor.GetPropertiesImpl(Object component, Attribute[] attributes, Boolean noCustomTypeDesc, Boolean noAttributes)
        /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs(1242,0): at System.ComponentModel.TypeDescriptor.GetProperties(Object component, Boolean noCustomTypeDesc)
        /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs(1232,0): at System.ComponentModel.TypeDescriptor.GetProperties(Object component)
        /_/src/libraries/System.ComponentModel.TypeConverter/tests/PropertyDescriptorTests.cs(221,0): at System.ComponentModel.Tests.PropertyDescriptorTests.PropertyDescriptorCanBeCreatedThatAccessesNonPublicPropertyOnAssociatedDesigner()
        /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs(22,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=368974
Build error leg or test failing:
Pull request: #90119

Error Message

{
  "ErrorMessage": "at System.ComponentModel.TypeDescriptor.NodeFor",
  "BuildRetry": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=368974
Error message validated: at System.ComponentModel.TypeDescriptor.NodeFor
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 8/10/2023 1:46:54 PM UTC

Report

Build Definition Test Pull Request
374116 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport
373453 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport
373115 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export #90519
372849 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export #90519
372550 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport
372445 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport #90270
372307 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export
372186 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport
372071 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export
371961 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport #90023
371811 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport
371518 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export
371313 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export #90413
370857 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export
370244 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export
369565 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export #90304
369870 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport #89712
369604 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export #90150
369496 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export
369482 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export #90298
369160 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport #90199
368974 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export #90119
368875 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export
368230 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport #90184
368204 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport #90225
367894 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport #90150
362691 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
3 26 27
@steveharter steveharter added blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' runtime-mono specific to the Mono runtime Known Build Error Use this to report build issues in the .NET Helix tab labels Aug 10, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Aug 10, 2023
@ghost
Copy link

ghost commented Aug 10, 2023

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

Issue Details

Error when running /azp run runtime-extra-platforms
windows.10.amd64.android.open

Several errors like:

  Starting:    System.ComponentModel.TypeConverter.Tests (parallel test collections = on, max threads = 2)
    System.ComponentModel.Tests.PropertyDescriptorTests.PropertyDescriptorCanBeCreatedThatAccessesNonPublicPropertyOnAssociatedDesigner [FAIL]
      System.PlatformNotSupportedException : Operation is not supported on this platform.
      Stack Trace:
        /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs(1545,0): at System.ComponentModel.TypeDescriptor.NodeFor(Object instance, Boolean createDelegator)
        /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs(1509,0): at System.ComponentModel.TypeDescriptor.NodeFor(Object instance)
        /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs(892,0): at System.ComponentModel.TypeDescriptor.GetDescriptor(Object component, Boolean noCustomTypeDesc)
        /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs(1299,0): at System.ComponentModel.TypeDescriptor.GetPropertiesImpl(Object component, Attribute[] attributes, Boolean noCustomTypeDesc, Boolean noAttributes)
        /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs(1242,0): at System.ComponentModel.TypeDescriptor.GetProperties(Object component, Boolean noCustomTypeDesc)
        /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs(1232,0): at System.ComponentModel.TypeDescriptor.GetProperties(Object component)
        /_/src/libraries/System.ComponentModel.TypeConverter/tests/PropertyDescriptorTests.cs(221,0): at System.ComponentModel.Tests.PropertyDescriptorTests.PropertyDescriptorCanBeCreatedThatAccessesNonPublicPropertyOnAssociatedDesigner()
        /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs(22,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=368974
Build error leg or test failing:
Pull request: #90119

Error Message

{
  "ErrorMessage": "at System.ComponentModel.TypeDescriptor.NodeFor",
  "BuildRetry": false
}
Author: steveharter
Assignees: -
Labels:

area-System.ComponentModel, blocking-clean-ci, runtime-mono, Known Build Error

Milestone: -

@steveharter steveharter added this to the 8.0.0 milestone Aug 10, 2023
@steveharter steveharter removed the untriaged New issue has not been triaged by the area owner label Aug 10, 2023
@ericstj
Copy link
Member

ericstj commented Aug 11, 2023

@JeremyKuhne it looks like this is regression from f43b0c1

else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
&& ComWrappers.TryGetComInstance(instance, out nint unknown))

Looks like these are running Mono on Windows. I guess mono runtime doesn't implement this. Can we get this condition updated to exclude Mono runtime?

@ericstj
Copy link
Member

ericstj commented Aug 14, 2023

Let's just wrap TryGetComInstance in a try/catch(PNSE)

@ericstj ericstj assigned ericstj and unassigned JeremyKuhne Aug 14, 2023
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Aug 14, 2023
jkotas added a commit to jkotas/runtime that referenced this issue Aug 14, 2023
Return false from ComWrappers.TryGetComInstance/TryGetObject instead of
throwing PNSE. It saves callers from needing to protect against PNSE.

Fix dotnet#90311
@ericstj ericstj assigned jkotas and unassigned ericstj Aug 15, 2023
@ghost
Copy link

ghost commented Aug 15, 2023

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

Issue Details

Error when running /azp run runtime-extra-platforms
windows.10.amd64.android.open

Several errors like:

  Starting:    System.ComponentModel.TypeConverter.Tests (parallel test collections = on, max threads = 2)
    System.ComponentModel.Tests.PropertyDescriptorTests.PropertyDescriptorCanBeCreatedThatAccessesNonPublicPropertyOnAssociatedDesigner [FAIL]
      System.PlatformNotSupportedException : Operation is not supported on this platform.
      Stack Trace:
        /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs(1545,0): at System.ComponentModel.TypeDescriptor.NodeFor(Object instance, Boolean createDelegator)
        /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs(1509,0): at System.ComponentModel.TypeDescriptor.NodeFor(Object instance)
        /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs(892,0): at System.ComponentModel.TypeDescriptor.GetDescriptor(Object component, Boolean noCustomTypeDesc)
        /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs(1299,0): at System.ComponentModel.TypeDescriptor.GetPropertiesImpl(Object component, Attribute[] attributes, Boolean noCustomTypeDesc, Boolean noAttributes)
        /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs(1242,0): at System.ComponentModel.TypeDescriptor.GetProperties(Object component, Boolean noCustomTypeDesc)
        /_/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs(1232,0): at System.ComponentModel.TypeDescriptor.GetProperties(Object component)
        /_/src/libraries/System.ComponentModel.TypeConverter/tests/PropertyDescriptorTests.cs(221,0): at System.ComponentModel.Tests.PropertyDescriptorTests.PropertyDescriptorCanBeCreatedThatAccessesNonPublicPropertyOnAssociatedDesigner()
        /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs(22,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=368974
Build error leg or test failing:
Pull request: #90119

Error Message

{
  "ErrorMessage": "at System.ComponentModel.TypeDescriptor.NodeFor",
  "BuildRetry": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=368974
Error message validated: at System.ComponentModel.TypeDescriptor.NodeFor
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 8/10/2023 1:46:54 PM UTC

Report

Build Definition Test Pull Request
373115 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export #90519
372849 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export #90519
372550 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport
372445 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport #90270
372307 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export
372186 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport
372071 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export
371961 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport #90023
371811 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport
371518 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export
371313 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export #90413
370857 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export
370244 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export
369565 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export #90304
369870 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport #89712
369604 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export #90150
369496 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export
369482 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export #90298
369160 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport #90199
368974 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export #90119
368875 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export
368230 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport #90184
368204 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport #90225
367894 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.CanExport #90150
362691 dotnet/runtime System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterApiTests.Export

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
4 24 25
Author: steveharter
Assignees: jkotas
Labels:

area-System.Runtime.InteropServices, blocking-release, blocking-clean-ci, runtime-mono, regression-from-last-release, in-pr, Known Build Error

Milestone: 8.0.0

jkotas added a commit that referenced this issue Aug 15, 2023
* Return false from ComWrappers.Try... methods

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

Fix #90311

* More efficient IsWindows check
github-actions bot pushed a commit that referenced this issue Aug 15, 2023
Return false from ComWrappers.TryGetComInstance/TryGetObject instead of
throwing PNSE. It saves callers from needing to protect against PNSE.

Fix #90311
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Aug 15, 2023
github-actions bot pushed a commit that referenced this issue Aug 15, 2023
Return false from ComWrappers.TryGetComInstance/TryGetObject instead of
throwing PNSE. It saves callers from needing to protect against PNSE.

Fix #90311
carlossanlop pushed a commit that referenced this issue Aug 16, 2023
* Return false from ComWrappers.Try... methods

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

Fix #90311

* More efficient IsWindows check

---------

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
@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.
Labels
area-System.Runtime.InteropServices blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' blocking-release Known Build Error Use this to report build issues in the .NET Helix tab regression-from-last-release runtime-mono specific to the Mono runtime
Projects
None yet
4 participants