The type initializer for 'VirtualDesktop.DesktopManager' threw an exception
Two days ago, my Windows 11 was upgraded to version 23H2. Now I get the following error:
get-desktoplist
Der Typeninitialisierer für "VirtualDesktop.DesktopManager" hat eine Ausnahme verursacht. In C:\Program Files\WindowsPowerShell\Modules\VirtualDesktop\1.5.6\VirtualDesktop.ps1:1227 Zeichen:16
-
for ($I = 0; $I -lt [VirtualDesktop.Desktop]::Count; $I++) -
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~- CategoryInfo : OperationStopped: (:) [], TypeInitializationException
- FullyQualifiedErrorId : System.TypeInitializationException
My Windows Version: Edition Windows 11 Enterprise Version 23H2 Installiert am 26.11.2023 Betriebssystembuild 22631.3085 Leistung Windows Feature Experience Pack 1000.22684.1000.0
Hello @bostergit,
I can commit the change with Windows 11 and the preview update for Win 11 23H2 (raises build from 3007 to 3085). However, I will wait until the next mandatory update before making any adjustments, otherwise it will no longer work with Windows 11 without this update.
Greetings Markus
hello @MScholtes, any chance of a pre-release with the changes?
@MScholtes just providing some more datapoints . (new-desktop crashes on exception)
windows 11 22h2 os build 22621.3085 psversion 5.1.22621.2506 windows version 10.0.22621.0
windows 11 23h2 os build 22631.3085 psversion 5.1.22621.2506 windows version 10.0.22631
Same for me. Just want to say thanks for providing these tools, really handy.
Windows 11 Pro 23H2 22631.3085 Windows Feature Experience Pack 1000.22684.1000.0
Hello all,
I uploaded a test release for Windows 11 23H2 3805. You can try it out the following way:
- download VirtualDesktop3085.ps1 from the root of this repository
- start Powershell in the same directory as the script
- execute
. .\VirtualDesktop3085.ps1
- test your commands for virtual desktops
I did successfully test with a Win11 23H2 3085, but I do not have Win11 22H2 3085 oder Win11 Insider. I would be very happy if someone could test this.
Greetings
Markus
Hello,
thanks. This worked for me. :)
Works for me. Thanks
Windows 11 Pro 23H2 22631.3085 Windows Feature Experience Pack 1000.22684.1000.0
Hello all,
I uploaded a test release for Windows 11 23H2 3805. You can try it out the following way:
- download VirtualDesktop3085.ps1 from the root of this repository
- start Powershell in the same directory as the script
- execute
. .\VirtualDesktop3085.ps1
- test your commands for virtual desktops
I did successfully test with a Win11 23H2 3085, but I do not have Win11 22H2 3085 oder Win11 Insider. I would be very happy if someone could test this.
Greetings
Markus
Worked for me too. Thanks.
Edit : After some uses (during development) it stopped again with the same error.
Hello all,
I uploaded a test release for Windows 11 23H2 3805. You can try it out the following way:
- download VirtualDesktop3085.ps1 from the root of this repository
- start Powershell in the same directory as the script
- execute
. .\VirtualDesktop3085.ps1
- test your commands for virtual desktops
I did successfully test with a Win11 23H2 3085, but I do not have Win11 22H2 3085 oder Win11 Insider. I would be very happy if someone could test this.
Greetings
Markus
works well
Yesterday's monthly mandatory Win 11 updates included the interface changes that break DesktopManager. I'm on Win11 23H2 build 22631.3007.
I just tested VirtualDesktop3085.ps1 and it's working great with my commands. Looking forward to a released version. Thanks for all your work on this!
Hello,
I updated this repository today and the package on PowerShell Gallery. With
Update-Module VirtualDesktop
or
Install-Module VirtualDesktop
you can install the new version 1.5.7.
I do still have no feedback to Windows 11 22H2 with the new patch. If someone would report I would be very thankful.
Greetings
Markus
I updated this repository today and the package on PowerShell Gallery.
Awesome, works great. Thanks so much, Markus!
Installed 1.5.7 but to no luck.
Hello @michael-akkermans,
please install the current February Windows Patch, this will raise your Windows version to 22621.3155 and version 1.5.7 of PSVirtualDesktop (I hope) will work. I still have no feedback if there are additional issues with Win 11 22H2.
If you want to wait some days with patching (not recommended), use the older version 1.5.6 of PSVirtualDesktop.
Greetings
Markus
Hi @MScholtes,
Indeed it works with the current February Windows Patch. Thanks for the feedback.
Issue solved