This one took a little time to figure out. I settled for the simplest possible fix, but described technically better/more correct solutions in my TODO comment.
Basically the problem is that the target in C# is "Any CPU", which means the process's "view" of the registry will be different when run on 32 and 64-bit platforms. Since VS is a 32-bit app, when you want to access it's data, if running on 32-bit Windows, it will be under SOFTWARE\Microsoft\etc. but when running on 64-bit Windows, it will be under SOFTWARE\Wow6432Node\Microsoft\etc.
This one took a little time to figure out. I settled for the simplest possible fix, but described technically better/more correct solutions in my TODO comment.
Basically the problem is that the target in C# is "Any CPU", which means the process's "view" of the registry will be different when run on 32 and 64-bit platforms. Since VS is a 32-bit app, when you want to access it's data, if running on 32-bit Windows, it will be under SOFTWARE\Microsoft\etc. but when running on 64-bit Windows, it will be under SOFTWARE\Wow6432Node\Microsoft\etc.