MScholtes / VirtualDesktop

C# command line tool to manage virtual desktops in Windows 10
MIT License
606 stars 60 forks source link

IVirtualDesktop.GetName() always return "Desktop " + (index + 1) even when name is set. #71

Closed bhtek closed 1 year ago

bhtek commented 1 year ago

When calling DesktopManager.GetDesktop(index).GetName(), getting

System.Runtime.InteropServices.MarshalDirectiveException: Cannot marshal 'return value': Invalid managed/unmanaged type combination.
   at System.StubHelpers.StubHelpers.ThrowInteropParamException(Int32 resID, Int32 paramIdx)
   at VirtualDesktop.Desktop.DesktopNameFromIndex(Int32 index) in C:\Users\boont\RiderProjects\WpfApp2\WpfApp2\ComInterop.cs:line 391
Edition Windows 11 Home
Version 22H2
Installed on    ‎20/‎6/‎2023
OS build    22621.2283
Serial number   PF4G76S6
Experience  Windows Feature Experience Pack 1000.22662.1000.0
MScholtes commented 1 year ago

Hello @bhtek,

this error does not occur. Wrong project?

Greetings

Markus

bhtek commented 1 year ago

Probably I did something wrongly. Thanks.

MScholtes commented 1 year ago

Hello @bhtek,

after thinking in peace and quiet I came to the conclusion that you try to comile against .Net Core. The code of VirtualDesktop is written for .Net Framework, this would explain the error.

Greetings

Markus