Skip to content

Maybe a bug. Electron.Screen.GetPrimaryDisplayAsync(); #944

Closed

Description

@markatosi
  • Version: 0.2
  • Target: .net 10.0, electron 38.2.2 node v22.12.0

Steps to Reproduce:

  1. Try to use await Electron.Screen.GetPrimaryDisplayAsync();
  2. Error:System.TimeoutException: No response after 1000ms trying to retrieve value screen.GetPrimaryDisplayAsync()

The Screen id is set to -1 so that's probably not correct.

Activity

  1. changed the title [-]Maybe a bug. This used to work[/-] [+]Maybe a bug. Electron.Screen.GetPrimaryDisplayAsync();[/+] on Nov 20, 2025
  2. softworkz commented on Nov 20, 2025

    @softworkz
    Collaborator

    I'm not sure how you got to those results.

    The GetPrimaryDisplayAsync() method is tested by the Primary_display_has_positive_dimensions test which is succeeding on all platforms (e.g. https://github.com/ElectronNET/Electron.NET/actions/runs/19494438431)

  3. markatosi commented on Nov 20, 2025

    @markatosi
    ContributorAuthor

    I have no idea either :-) All I did was migrate from electron-sharp to ElectronNet Core.
    I did test on MacOS 26.1 and 15.4.

    I also tested the bare bones demo app. Doesn't work on that one either.

    Is there anything you can recommend that I do to prove that it's not working for me?

  4. softworkz commented on Nov 20, 2025

    @softworkz
    Collaborator

    Is it like that's the one thing not working and everything else is fine, or is this the first thing your app does and you didn't look any further?

    Is there anything you can recommend that I do to prove that it's not working for me?

    A minimal app which exposes that problem would be helpful to look at what you are doing. (unless your code is open anyway.. :-)

  5. markatosi commented on Nov 20, 2025

    @markatosi
    ContributorAuthor

    That was the only thing that I noticed wasn't working. Everything else has been fine. Code isn't open but the minimal app i can post

  6. softworkz commented on Nov 20, 2025

    @softworkz
    Collaborator

    Is there anything you can recommend that I do to prove that it's not working for me?

    You could check out the develop branch and run dotnet test on that machine, so that we have a baseline (known to be working) for comparison.

  7. softworkz commented on Nov 20, 2025

    @softworkz
    Collaborator

    That includes the test for the screen.API.

  8. markatosi commented on Nov 20, 2025

    @markatosi
    ContributorAuthor

    Full error from the minimal app.

    warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
          Unhandled exception rendering component: No response after 1000ms trying to retrieve value screen.GetPrimaryDisplayAsync()
          System.TimeoutException: No response after 1000ms trying to retrieve value screen.GetPrimaryDisplayAsync()
             at BlazorApp1.Components.Pages.Counter.IncrementCount() in /Volumes/Repos_APFS/source/electron/BlazorApp1/Components/Pages/Counter.razor:line 18
             at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
             at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
    fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
          Unhandled exception in circuit 'MNA7dNRZPzivVU5nG-BitNuuwFbp8AR4b3LgQ9kMH0I'.
          System.TimeoutException: No response after 1000ms trying to retrieve value screen.GetPrimaryDisplayAsync()
             at BlazorApp1.Components.Pages.Counter.IncrementCount() in /Volumes/Repos_APFS/source/electron/BlazorApp1/Components/Pages/Counter.razor:line 18
             at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
             at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
    
    
  9. softworkz commented on Nov 20, 2025

    @softworkz
    Collaborator

    This is not the default app startup. How do you do this?

    Did you look at the example AspNet app?

    Most likely you're just doing this too early?

  10. markatosi commented on Nov 20, 2025

    @markatosi
    ContributorAuthor

    https://github.com/markatosi?tab=repositories BlazorApp1

    The call to the method is via the counter button on the counter.razor

  11. softworkz commented on Nov 20, 2025

    @softworkz
    Collaborator

    I've cloned it. But I need to get some sleep. Will look at it tomorrow.

  12. markatosi commented on Nov 20, 2025

    @markatosi
    ContributorAuthor

    Did you look at the example AspNet app?

    Most likely you're just doing this too early?

    I just followed the Blazor setup that is on the home page for this project with the exception of the WASM stuff since this is a blazor server app.

  13. markatosi commented on Nov 20, 2025

    @markatosi
    ContributorAuthor

    Test Results osx-arm64 Main branch

    Image

    All tests from Solution.txt

  14. markatosi commented on Nov 20, 2025

    @markatosi
    ContributorAuthor

    Test Results osx-arm64 develop branch

    Image

    All tests from Solution Dev.txt

  15. 17 remaining items

  16. markatosi commented on Nov 20, 2025

    @markatosi
    ContributorAuthor

    When i run the screen tests in the test debugger i'm getting an error with serialization

    public void Once<T>(string eventName, Action<T> action)
    
    System.Text.Json.JsonException: The JSON value could not be converted to System.Int32. Path: $[0].displayFrequency | LineNumber: 0 | BytePositionInLine: 247.
     ---> System.FormatException: Either the JSON value is not in a supported format, or is out of bounds for an Int32.
       at System.Text.Json.ThrowHelper.ThrowFormatException(NumericType numericType)
       at System.Text.Json.Utf8JsonReader.GetInt32()
       at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)
       at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
       at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
       at System.Text.Json.Serialization.JsonCollectionConverter`2.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value)
       at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
       at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)
       --- End of inner exception stack trace ---
       at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, Utf8JsonReader& reader, Exception ex)
       at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)
       at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.Deserialize(Utf8JsonReader& reader, ReadStack& state)
       at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 utf8Json, JsonTypeInfo`1 jsonTypeInfo, Nullable`1 actualByteCount)
       at System.Text.Json.JsonSerializer.ReadFromNode[TValue](JsonNode node, JsonTypeInfo`1 jsonTypeInfo)
       at SocketIO.Serializer.SystemTextJson.SystemTextJsonSerializer.Deserialize[T](IMessage message, Int32 index)
       at SocketIOClient.SocketIOResponse.GetValue[T](Int32 index)
       at ElectronNET.API.SocketIoFacade.<>c__DisplayClass13_1`1.<Once>b__1() in /Volumes/Repos_APFS/source/electron/electron-net-softworkz/ElectronNET/src/ElectronNET.API/Bridge/SocketIOFacade.cs:line 86
       at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
    
  17. softworkz commented on Nov 20, 2025

    @softworkz
    Collaborator

    Ha! That looks like we found the culprit!

  18. markatosi commented on Nov 20, 2025

    @markatosi
    ContributorAuthor

    Here's the output after enabling the logger

     dotnet test
    Restore complete (0.6s)
      ElectronNET.API net10.0 succeeded (1.5s) → /Volumes/Repos_APFS/source/electron/electron-net-softworkz/ElectronNET/src/ElectronNET.API/bin/Debug/net10.0/ElectronNET.API.dll
      ElectronNET net10.0 succeeded (0.2s) → /Volumes/Repos_APFS/source/electron/electron-net-softworkz/ElectronNET/src/ElectronNET/bin/Debug/net10.0/ElectronNET.dll
      ElectronNET.IntegrationTests net10.0 osx-arm64 succeeded (0.3s) → bin/Debug/net10.0/osx-arm64/ElectronNET.IntegrationTests.dll
    [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v3.1.5+1b188a7b0a (64-bit .NET 10.0.0)
    [xUnit.net 00:00:00.04]   Discovering: ElectronNET.IntegrationTests (app domain = off, method display = Method, method display options = None)
    [xUnit.net 00:00:00.06]   Discovered:  ElectronNET.IntegrationTests (93 test cases to be run)
    [xUnit.net 00:00:00.08]   Starting:    ElectronNET.IntegrationTests (parallel test collections = off, stop on fail = off, explicit = off)
    [xUnit.net 00:00:00.09]     Resize_and_crop_produce_expected_sizes [SKIP]
    [xUnit.net 00:00:00.09]       Only supported on Windows
    [xUnit.net 00:00:00.10]     Create_from_buffer_and_to_data_url [SKIP]
    [xUnit.net 00:00:00.10]       Only supported on Windows
    [xUnit.net 00:00:00.10]     Add_representation_for_scale_factor [SKIP]
    [xUnit.net 00:00:00.10]       Only supported on Windows
    [xUnit.net 00:00:00.10]     Create_from_bitmap_and_to_png [SKIP]
    [xUnit.net 00:00:00.10]       Only supported on Windows
    [ElectronFixture] InitializeAsync: start
    [ElectronFixture] Acquire RuntimeController
    GatherBuildInfo: Detected testhost
    Probe scored for launch origin:   DotNet 2 vs. 0 Electron
    Probe scored for package mode:   Unpackaged 3 vs. 0 Packaged
    Evaluated StartupMethod: UnpackedDotnetFirst
    [ElectronFixture] Starting Electron runtime...
    [StartCore]: isUnPacked: True
    [StartCore]: electronBinaryName: electronnet-integrationtests
    [StartCore]: args: --no-sandbox /Volumes/Repos_APFS/source/electron/electron-net-softworkz/ElectronNET/src/ElectronNET.IntegrationTests/bin/Debug/net10.0/osx-arm64/testhost.dll --port 54189 --endpoint 127.0.0.1:054189 --role client --parentprocessid 52593 --telemetryoptedin false
    [StartCore]: Before Start
    [ElectronFixture] Waiting for Ready...
    [StartInternal]: startCmd: /Volumes/Repos_APFS/source/electron/electron-net-softworkz/ElectronNET/src/ElectronNET.IntegrationTests/bin/Debug/net10.0/osx-arm64/.electron/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron
    [StartInternal]: args: main.js -unpackeddotnet --trace-warnings -electronforcedport=8000 --no-sandbox /Volumes/Repos_APFS/source/electron/electron-net-softworkz/ElectronNET/src/ElectronNET.IntegrationTests/bin/Debug/net10.0/osx-arm64/testhost.dll --port 54189 --endpoint 127.0.0.1:054189 --role client --parentprocessid 52593 --telemetryoptedin false
    || Entry!!!:  
    || unpackedelectron! dir: /Volumes/Repos_APFS/source/electron/electron-net-softworkz/ElectronNET/src/ElectronNET.IntegrationTests/bin/Debug/net10.0/osx-arm64/.electron
    [StartInternal]: after run:
    || Electron Socket IO (forced) Port: 8000
    || Electron Socket: starting...
    || Electron Socket: listening on port 8000 at ::1
    || Electron Socket: connected!
    || Electron Socket: loading components...
    || Electron Socket: startup complete.
    BridgeConnector connected!
    [ElectronFixture] Runtime Ready
    || [52598:1120/115103.490372:WARNING:runtime_features.cc(730)] AttributionReportingCrossAppWeb cannot be enabled in this configuration. Use --enable-features=ConversionMeasurement,AttributionReportingCrossAppWeb in addition.
    || [52595:1120/115103.660175:INFO:CONSOLE(2)] "%cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
    ||   Policy set or a policy with "unsafe-eval" enabled. This exposes users of
    ||   this app to unnecessary security risks.
    || 
    || For more information and help, consult
    || https://electronjs.org/docs/tutorial/security.
    || This warning will not show up
    || once the app is packaged.", source: node:electron/js2c/renderer_init (2)
    || [52595:1120/115104.023031:INFO:CONSOLE(2)] "%cElectron Security Warning (Node.js Integration with Remote Content) font-weight: bold; This renderer process has Node.js integration enabled
    ||     and attempted to load remote content from 'https://example.com/'. This
    ||     exposes users of this app to severe security risks.
    || 
    || For more information and help, consult
    || https://electronjs.org/docs/tutorial/security.
    || This warning will not show up
    || once the app is packaged.", source: node:electron/js2c/renderer_init (2)
    || [52595:1120/115104.023060:INFO:CONSOLE(2)] "%cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
    ||   Policy set or a policy with "unsafe-eval" enabled. This exposes users of
    ||   this app to unnecessary security risks.
    || 
    || For more information and help, consult
    || https://electronjs.org/docs/tutorial/security.
    || This warning will not show up
    || once the app is packaged.", source: node:electron/js2c/renderer_init (2)
         Warning:
         The component "Fluent Assertions" is governed by the rules defined in the Xceed License Agreement and
         the Xceed Fluent Assertions Community License. You may use Fluent Assertions free of charge for
         non-commercial use only. An active subscription is required to use Fluent Assertions for commercial use.
         Please contact Xceed Sales mailto:sales@xceed.com to acquire a subscription at a very low cost.
         A paid commercial license supports the development and continued increasing support of
         Fluent Assertions users under both commercial and community licenses. Help us
         keep Fluent Assertions at the forefront of unit testing.
         For more information, visit https://xceed.com/products/unit-testing/fluent-assertions/
    || [52600:1120/115104.056449:WARNING:runtime_features.cc(730)] AttributionReportingCrossAppWeb cannot be enabled in this configuration. Use --enable-features=ConversionMeasurement,AttributionReportingCrossAppWeb in addition.
    || [52604:1120/115104.195552:WARNING:runtime_features.cc(730)] AttributionReportingCrossAppWeb cannot be enabled in this configuration. Use --enable-features=ConversionMeasurement,AttributionReportingCrossAppWeb in addition.
    || [52595:1120/115104.208731:INFO:CONSOLE(2)] "%cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
    ||   Policy set or a policy with "unsafe-eval" enabled. This exposes users of
    ||   this app to unnecessary security risks.
    || 
    || For more information and help, consult
    || https://electronjs.org/docs/tutorial/security.
    || This warning will not show up
    || once the app is packaged.", source: node:electron/js2c/renderer_init (2)
    || [52595:1120/115104.239290:INFO:CONSOLE(2)] "%cElectron Security Warning (Node.js Integration with Remote Content) font-weight: bold; This renderer process has Node.js integration enabled
    ||     and attempted to load remote content from 'https://example.com/'. This
    ||     exposes users of this app to severe security risks.
    || 
    || For more information and help, consult
    || https://electronjs.org/docs/tutorial/security.
    || This warning will not show up
    || once the app is packaged.", source: node:electron/js2c/renderer_init (2)
    || [52595:1120/115104.239374:INFO:CONSOLE(2)] "%cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
    ||   Policy set or a policy with "unsafe-eval" enabled. This exposes users of
    ||   this app to unnecessary security risks.
    || 
    || For more information and help, consult
    || https://electronjs.org/docs/tutorial/security.
    || This warning will not show up
    || once the app is packaged.", source: node:electron/js2c/renderer_init (2)
    || [52595:1120/115104.891023:INFO:CONSOLE(2)] "%cElectron Security Warning (Node.js Integration with Remote Content) font-weight: bold; This renderer process has Node.js integration enabled
    ||     and attempted to load remote content from 'https://example.com/'. This
    ||     exposes users of this app to severe security risks.
    || 
    || For more information and help, consult
    || https://electronjs.org/docs/tutorial/security.
    || This warning will not show up
    || once the app is packaged.", source: node:electron/js2c/renderer_init (2)
    || [52595:1120/115104.891070:INFO:CONSOLE(2)] "%cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
    ||   Policy set or a policy with "unsafe-eval" enabled. This exposes users of
    ||   this app to unnecessary security risks.
    || 
    || For more information and help, consult
    || https://electronjs.org/docs/tutorial/security.
    || This warning will not show up
    || once the app is packaged.", source: node:electron/js2c/renderer_init (2)
    || [52612:1120/115104.915414:WARNING:runtime_features.cc(730)] AttributionReportingCrossAppWeb cannot be enabled in this configuration. Use --enable-features=ConversionMeasurement,AttributionReportingCrossAppWeb in addition.
    || [52595:1120/115104.952320:INFO:CONSOLE(2)] "%cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
    ||   Policy set or a policy with "unsafe-eval" enabled. This exposes users of
    ||   this app to unnecessary security risks.
    || 
    || For more information and help, consult
    || https://electronjs.org/docs/tutorial/security.
    || This warning will not show up
    || once the app is packaged.", source: node:electron/js2c/renderer_init (2)
    [xUnit.net 00:00:03.39]     SetThumbarButtons_returns_success [SKIP]
    [xUnit.net 00:00:03.39]       Only supported on Windows
    [xUnit.net 00:00:03.39]     Thumbar_button_click_invokes_callback [SKIP]
    [xUnit.net 00:00:03.39]       Only supported on Windows
    [xUnit.net 00:00:03.39]     OpenExternal_invalid_scheme_returns_error_or_empty [SKIP]
    [xUnit.net 00:00:03.39]       This can keep the test process hanging until the e-mail window is closed
    [xUnit.net 00:00:04.46]     GetAllDisplays_returns_at_least_one [FAIL]
    [xUnit.net 00:00:04.46]       System.TimeoutException : No response after 1000ms trying to retrieve value screen.GetAllDisplaysAsync()
    [xUnit.net 00:00:04.46]       Stack Trace:
    [xUnit.net 00:00:04.46]         /Volumes/Repos_APFS/source/electron/electron-net-softworkz/ElectronNET/src/ElectronNET.IntegrationTests/Tests/ScreenTests.cs(30,0): at ElectronNET.IntegrationTests.Tests.ScreenTests.GetAllDisplays_returns_at_least_one()
    [xUnit.net 00:00:04.46]         --- End of stack trace from previous location ---
    [xUnit.net 00:00:05.47]     GetDisplayNearestPoint_check [FAIL]
    [xUnit.net 00:00:05.47]       System.TimeoutException : No response after 1000ms trying to retrieve value screen.GetDisplayNearestPointAsync()
    [xUnit.net 00:00:05.47]       Stack Trace:
    [xUnit.net 00:00:05.47]         /Volumes/Repos_APFS/source/electron/electron-net-softworkz/ElectronNET/src/ElectronNET.IntegrationTests/Tests/ScreenTests.cs(64,0): at ElectronNET.IntegrationTests.Tests.ScreenTests.GetDisplayNearestPoint_check()
    [xUnit.net 00:00:05.47]         --- End of stack trace from previous location ---
    [xUnit.net 00:00:06.48]     GetDisplayMatching_check [FAIL]
    [xUnit.net 00:00:06.48]       System.TimeoutException : No response after 1000ms trying to retrieve value screen.GetDisplayMatchingAsync()
    [xUnit.net 00:00:06.48]       Stack Trace:
    [xUnit.net 00:00:06.48]         /Volumes/Repos_APFS/source/electron/electron-net-softworkz/ElectronNET/src/ElectronNET.IntegrationTests/Tests/ScreenTests.cs(80,0): at ElectronNET.IntegrationTests.Tests.ScreenTests.GetDisplayMatching_check()
    [xUnit.net 00:00:06.48]         --- End of stack trace from previous location ---
    [xUnit.net 00:00:07.48]     Primary_display_has_positive_dimensions [FAIL]
    [xUnit.net 00:00:07.48]       System.TimeoutException : No response after 1000ms trying to retrieve value screen.GetPrimaryDisplayAsync()
    [xUnit.net 00:00:07.48]       Stack Trace:
    [xUnit.net 00:00:07.48]         /Volumes/Repos_APFS/source/electron/electron-net-softworkz/ElectronNET/src/ElectronNET.IntegrationTests/Tests/ScreenTests.cs(22,0): at ElectronNET.IntegrationTests.Tests.ScreenTests.Primary_display_has_positive_dimensions()
    [xUnit.net 00:00:07.48]         --- End of stack trace from previous location ---
    || [52633:1120/115109.099003:WARNING:runtime_features.cc(730)] AttributionReportingCrossAppWeb cannot be enabled in this configuration. Use --enable-features=ConversionMeasurement,AttributionReportingCrossAppWeb in addition.
    || [52595:1120/115109.135090:INFO:CONSOLE(2)] "%cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
    ||   Policy set or a policy with "unsafe-eval" enabled. This exposes users of
    ||   this app to unnecessary security risks.
    || 
    || For more information and help, consult
    || https://electronjs.org/docs/tutorial/security.
    || This warning will not show up
    || once the app is packaged.", source: node:electron/js2c/renderer_init (2)
    || [52595:1120/115111.743782:INFO:CONSOLE(2)] "%cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
    ||   Policy set or a policy with "unsafe-eval" enabled. This exposes users of
    ||   this app to unnecessary security risks.
    || 
    || For more information and help, consult
    || https://electronjs.org/docs/tutorial/security.
    || This warning will not show up
    || once the app is packaged.", source: node:electron/js2c/renderer_init (2)
    [xUnit.net 00:00:11.32]     HostHook_call_returns_value [SKIP]
    [xUnit.net 00:00:11.32]       Requires HostHook setup; skipping
    [xUnit.net 00:00:11.32]     Cookie_set_get_remove_sequence [SKIP]
    [xUnit.net 00:00:11.32]       Cookie set/get requires navigation to domain; skipping until test harness serves page
    || [52638:1120/115113.456003:WARNING:runtime_features.cc(730)] AttributionReportingCrossAppWeb cannot be enabled in this configuration. Use --enable-features=ConversionMeasurement,AttributionReportingCrossAppWeb in addition.
    || [52595:1120/115113.491629:INFO:CONSOLE(2)] "%cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
    ||   Policy set or a policy with "unsafe-eval" enabled. This exposes users of
    ||   this app to unnecessary security risks.
    || 
    || For more information and help, consult
    || https://electronjs.org/docs/tutorial/security.
    || This warning will not show up
    || once the app is packaged.", source: node:electron/js2c/renderer_init (2)
    || [52595:1120/115113.958680:INFO:CONSOLE(2)] "%cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
    ||   Policy set or a policy with "unsafe-eval" enabled. This exposes users of
    ||   this app to unnecessary security risks.
    || 
    || For more information and help, consult
    || https://electronjs.org/docs/tutorial/security.
    || This warning will not show up
    || once the app is packaged.", source: node:electron/js2c/renderer_init (2)
    || [52646:1120/115115.507366:WARNING:runtime_features.cc(730)] AttributionReportingCrossAppWeb cannot be enabled in this configuration. Use --enable-features=ConversionMeasurement,AttributionReportingCrossAppWeb in addition.
    || [52595:1120/115115.542678:INFO:CONSOLE(2)] "%cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
    ||   Policy set or a policy with "unsafe-eval" enabled. This exposes users of
    ||   this app to unnecessary security risks.
    || 
    || For more information and help, consult
    || https://electronjs.org/docs/tutorial/security.
    || This warning will not show up
    || once the app is packaged.", source: node:electron/js2c/renderer_init (2)
    || [52647:1120/115116.318384:WARNING:runtime_features.cc(730)] AttributionReportingCrossAppWeb cannot be enabled in this configuration. Use --enable-features=ConversionMeasurement,AttributionReportingCrossAppWeb in addition.
    || [52595:1120/115116.352146:INFO:CONSOLE(2)] "%cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
    ||   Policy set or a policy with "unsafe-eval" enabled. This exposes users of
    ||   this app to unnecessary security risks.
    || 
    || For more information and help, consult
    || https://electronjs.org/docs/tutorial/security.
    || This warning will not show up
    || once the app is packaged.", source: node:electron/js2c/renderer_init (2)
    [xUnit.net 00:00:16.23]     Menu_bar_visibility_and_auto_hide [SKIP]
    [xUnit.net 00:00:16.23]       Only supported on Linux and Windows
    [xUnit.net 00:00:16.23]     MenuBar_auto_hide_and_visibility [SKIP]
    [xUnit.net 00:00:16.23]       Only supported on Linux and Windows
    || [52649:1120/115121.558745:WARNING:runtime_features.cc(730)] AttributionReportingCrossAppWeb cannot be enabled in this configuration. Use --enable-features=ConversionMeasurement,AttributionReportingCrossAppWeb in addition.
    || [52595:1120/115121.595816:INFO:CONSOLE(2)] "%cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
    ||   Policy set or a policy with "unsafe-eval" enabled. This exposes users of
    ||   this app to unnecessary security risks.
    || 
    || For more information and help, consult
    || https://electronjs.org/docs/tutorial/security.
    || This warning will not show up
    || once the app is packaged.", source: node:electron/js2c/renderer_init (2)
    || [52595:1120/115122.058967:INFO:CONSOLE(2)] "%cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
    ||   Policy set or a policy with "unsafe-eval" enabled. This exposes users of
    ||   this app to unnecessary security risks.
    || 
    || For more information and help, consult
    || https://electronjs.org/docs/tutorial/security.
    || This warning will not show up
    || once the app is packaged.", source: node:electron/js2c/renderer_init (2)
    || Skip checkForUpdates because application is not packed and dev update config is not forced
    || Skip checkForUpdates because application is not packed and dev update config is not forced
    [ElectronFixture] Stopping Electron runtime...
    BridgeConnector disconnected!
    [ElectronFixture] Runtime stopped
    [xUnit.net 00:00:21.05]   Finished:    ElectronNET.IntegrationTests
      ElectronNET.IntegrationTests test net10.0 osx-arm64 failed with 4 error(s) (21.4s)
        /Volumes/Repos_APFS/source/electron/electron-net-softworkz/ElectronNET/src/ElectronNET.IntegrationTests/Tests/ScreenTests.cs(30): error TESTERROR: 
          GetAllDisplays_returns_at_least_one (1s 2ms): Error Message: System.TimeoutException : No response after 1000ms trying to retrieve value screen.GetAllDisplaysAsync()
          Stack Trace:
             at ElectronNET.IntegrationTests.Tests.ScreenTests.GetAllDisplays_returns_at_least_one() in /Volumes/Repos_APFS/source/electron/electron-net-softworkz/ElectronNET/src/ElectronNET.IntegrationTests/Tests/ScreenTests.cs:line 30
          --- End of stack trace from previous location ---
        /Volumes/Repos_APFS/source/electron/electron-net-softworkz/ElectronNET/src/ElectronNET.IntegrationTests/Tests/ScreenTests.cs(64): error TESTERROR: 
          GetDisplayNearestPoint_check (1s 2ms): Error Message: System.TimeoutException : No response after 1000ms trying to retrieve value screen.GetDisplayNearestPointAsync()
          Stack Trace:
             at ElectronNET.IntegrationTests.Tests.ScreenTests.GetDisplayNearestPoint_check() in /Volumes/Repos_APFS/source/electron/electron-net-softworkz/ElectronNET/src/ElectronNET.IntegrationTests/Tests/ScreenTests.cs:line 64
          --- End of stack trace from previous location ---
        /Volumes/Repos_APFS/source/electron/electron-net-softworkz/ElectronNET/src/ElectronNET.IntegrationTests/Tests/ScreenTests.cs(80): error TESTERROR: 
          GetDisplayMatching_check (1s 2ms): Error Message: System.TimeoutException : No response after 1000ms trying to retrieve value screen.GetDisplayMatchingAsync()
          Stack Trace:
             at ElectronNET.IntegrationTests.Tests.ScreenTests.GetDisplayMatching_check() in /Volumes/Repos_APFS/source/electron/electron-net-softworkz/ElectronNET/src/ElectronNET.IntegrationTests/Tests/ScreenTests.cs:line 80
          --- End of stack trace from previous location ---
        /Volumes/Repos_APFS/source/electron/electron-net-softworkz/ElectronNET/src/ElectronNET.IntegrationTests/Tests/ScreenTests.cs(22): error TESTERROR: 
          Primary_display_has_positive_dimensions (1s 1ms): Error Message: System.TimeoutException : No response after 1000ms trying to retrieve value screen.GetPrimaryDisplayAsync()
          Stack Trace:
             at ElectronNET.IntegrationTests.Tests.ScreenTests.Primary_display_has_positive_dimensions() in /Volumes/Repos_APFS/source/electron/electron-net-softworkz/ElectronNET/src/ElectronNET.IntegrationTests/Tests/ScreenTests.cs:line 22
          --- End of stack trace from previous location ---
    
    Test summary: total: 93, failed: 4, succeeded: 78, skipped: 11, duration: 21.4s
    Build failed with 4 error(s) in 24.4s
    
  19. softworkz commented on Nov 20, 2025

    @softworkz
    Collaborator

    Here's the output after enabling the logger

    Thanks - but no longer needed. The error is on our side.

    I think it's due to the migration to System.Text.Json: The Json.NET serializers have probably ignored the type mismatch for DisplayFrequency while System.Text.Json does not.

  20. markatosi commented on Nov 20, 2025

    @markatosi
    ContributorAuthor

    I think it's due to the migration to System.Text.Json: The Json.NET serializers have probably ignored the type mismatch for DisplayFrequency while System.Text.Json does not.

    I doubt they "ignored" the type mismatch. Newtonsoft just gracefully handled it and no one was the wiser. i still need to use JSON.net in places because it just "works" for some things that seem impossible for system.text.json to do without a lot of hair pulling.

    Also, i wouldn't take much stock in github integration tests "passing" at least with respect to macos. I've had plenty of issues with nonsense there. There might be something different about how system.text.json works on .net for mac. Might be worth creating an issue with the dotnet team because it shouldn't work on windows and fail on a mac.

  21. markatosi commented on Nov 20, 2025

    @markatosi
    ContributorAuthor

    Anyway, I'm happy to run integration testing on my mac whenever you need me to if you want a real test done. Just let me know

  22. softworkz commented on Nov 20, 2025

    @softworkz
    Collaborator

    Also, i wouldn't take much stock in github integration tests "passing" at least with respect to macos.

    I'm quite satisfied with it so far.

    I thought it would be obvious, but in case you're wondering why it didn't fail: Because Displayfrequency values are integers there.. 😜

  23. softworkz commented on Nov 20, 2025

    @softworkz
    Collaborator

    I doubt they "ignored" the type mismatch. Newtonsoft just gracefully handled it and no one was the wiser.

    What would be the difference between "ignored" and "gracefully handled"?

  24. markatosi commented on Nov 20, 2025

    @markatosi
    ContributorAuthor

    What would be the difference between "ignored" and "gracefully handled"?

    I guess converting the floating point or decimal or whatever it is to an integer. Maybe it's an 80/20 type solution :-)
    We'll give you a mostly correct answer which is probably good enough most of the time.

  25. markatosi commented on Nov 20, 2025

    @markatosi
    ContributorAuthor

    Anyway, thanks for all your improvements to ElectronNet. The fact that i can debug the application without having to attach to the asp.net core process separately is awesome.

  26. softworkz commented on Nov 20, 2025

    @softworkz
    Collaborator

    I guess converting the floating point or decimal or whatever it is to an integer. Maybe it's an 80/20 type solution :-)
    We'll give you a mostly correct answer which is probably good enough most of the time.

    Hmm, that would be a crazily invalid behavior. But I don't know they're really doing.


    Other note: A quick fix for you - until it's fixed here - might be to change your monitor refresh rate to an integral value - LOL 🤣

  27. markatosi commented on Nov 20, 2025

    @markatosi
    ContributorAuthor

    Other note: A quick fix for you - until it's fixed here - might be to change your monitor refresh rate to an integral value - LOL 🤣

    Now that's funny.

  28. added this to the 0.3.0 milestone on Nov 20, 2025
  29. agracio commented on Nov 24, 2025

    @agracio
    Contributor

    In some monitor reviews on YouTube I have seen multiple instances of monitors reporting decimal refresh value on Windows as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions