Troubleshooting: Manipulating the Registry

In working with the registry, you may encounter specific exceptions. This topic lists the most common exceptions and provides suggestions on how to address each of them.

Exceptions

The following table lists exceptions that may occur while working with the registry and provides tips on how to address them.

Exception

Suggestion

ArgumentException

Make sure the key you are performing an operation on exists, and that the path you have supplied is both correct and not over 255 characters.

SecurityException

Make sure you have read and write permissions from RegistryPermissionAccess.

UnauthorizedAccessException

Make sure the key was opened for writing if attempting to write to it.

See Also

Concepts

Common Registry Tasks

Reading from and Writing to the Registry Using My

Reading from and Writing to the Registry Using the Microsoft.Win32 Namespace

Security and the Registry

Reference

My.Computer.Registry Object

Other Resources

Walkthrough: Creating a Registry Key and Changing Its Values