KeyLayoutAutoSwitch crashes on rule editing (maybe .Net Framework 4.6 related?)

#8 · closed · 7 comments

View on GitHub ↗

ablazhov

Is it possible to compile KeyLayoutAutoSwitch for .Net 4.6? The computer I am using in the office runs Windows 10 1511 and it's not supported by .Net 4.7+... Damn!

Comments

AlexVallat

Possibly. Try extracting this file next to KeyLayoutAutoSwitch.exe and see if it will run. [KeyLayoutAutoSwitch.exe.config.zip](https://github.com/AlexVallat/KeyLayoutAutoSwitch/files/5983515/KeyLayoutAutoSwitch.exe.config.zip)

ablazhov

Turns out it isn't dotNet's fault. Something else is not right with this system because KeyLayoutAutoSwitch starts normaly, but it crashes with an Unhandled exception when I try to edit a rule. Thanks anyway! P.S. KeyLayoutAutoSwitch runs fine with .Net Framework 4.6 on other systems - no .config file is needed.

AlexVallat

Thanks for letting me know. If you want, you can post the details of the exception and I might be able to guess what's going on.

ablazhov

Here you go: [KLAS_UnhandledException.txt](https://github.com/AlexVallat/KeyLayoutAutoSwitch/files/5988172/KLAS_UnhandledException.txt)

AlexVallat

Most likely cause is a missing registry key under HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layouts It will look there for the keyboard layout information for all your installed layouts and if the key for the layout ID is missing, WinForms will throw this error. As to how the registry could get into that state, I do not know! Maybe try uninstalling and re-installing the keyboard layout?

ablazhov

OMG - You nailed it !!! I found some renamed keys under HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layouts and now I start to remember me fiddling with these keys a long time ago trying to stop Win10 adding random keyboard layouts. Thanks! I think we should consider this issue closed?

AlexVallat

Great, thanks for letting me know