question

BrianWheatley-5928 avatar image
0 Votes"
BrianWheatley-5928 asked RLWA32-6355 answered

C# Registry does not create key in the correct place?

I can successfully open the parent key:

RegistryKey key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\CLASSES\\CLSID\\", true);

When I look at the key by setting a break point an hovering over it with the mouse the proper path shows. However, when I create a subkey using the code below it does not appear on that path in the registry.

key.CreateSubKey("{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}");

Using the search function in the registry editor I find the key has instead been placed in the path Computer\HKEY_CLASSES_ROOT\WOW6432Node\CLSID\

How do I get this to go to the correct location?

dotnet-csharp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

RLWA32-6355 avatar image
0 Votes"
RLWA32-6355 answered

Your are creating your subkey in the 32-bit view of the registry because you have most likely created a 32-bit application.

Make sure that you build your application for x64 or that if you build for AnyCPU that prefer 32-bit is unchecked.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.