Microsoft.Win32.Registry.AccessControl
10.0.3
Prefix Reserved
See the version list below for details.
dotnet add package Microsoft.Win32.Registry.AccessControl --version 10.0.3
NuGet\Install-Package Microsoft.Win32.Registry.AccessControl -Version 10.0.3
<PackageReference Include="Microsoft.Win32.Registry.AccessControl" Version="10.0.3" />
<PackageVersion Include="Microsoft.Win32.Registry.AccessControl" Version="10.0.3" />
<PackageReference Include="Microsoft.Win32.Registry.AccessControl" />
paket add Microsoft.Win32.Registry.AccessControl --version 10.0.3
#r "nuget: Microsoft.Win32.Registry.AccessControl, 10.0.3"
#:package Microsoft.Win32.Registry.AccessControl@10.0.3
#addin nuget:?package=Microsoft.Win32.Registry.AccessControl&version=10.0.3
#tool nuget:?package=Microsoft.Win32.Registry.AccessControl&version=10.0.3
About
Provides support for managing access control lists for Microsoft.Win32.RegistryKey.
Key Features
- Get access control lists for a registry key.
- Get a specific sections of an access control list.
- Set the access control list for a registry key.
How to Use
using Microsoft.Win32;
using System.Security.AccessControl;
// Open a registry key (or create it if it doesn't exist)
using RegistryKey registryKey = Registry.CurrentUser.CreateSubKey("TestKey");
if (registryKey == null)
{
Console.WriteLine("Failed to create or open the registry key.");
return;
}
// Get the current access control list (ACL) for the registry key
RegistrySecurity registrySecurity = registryKey.GetAccessControl();
Console.WriteLine("Current Access Control List (ACL):");
Console.WriteLine(registrySecurity.GetSecurityDescriptorSddlForm(AccessControlSections.Access));
// Create a new access rule granting full control to the current user
string currentUser = Environment.UserName;
RegistryAccessRule accessRule = new RegistryAccessRule(currentUser, RegistryRights.FullControl, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow);
// Add the new access rule to the ACL
registrySecurity.AddAccessRule(accessRule);
// Set the updated ACL on the registry key
registryKey.SetAccessControl(registrySecurity);
// Get and display the updated ACL for the registry key using the second GetAccessControl overload
RegistrySecurity updatedRegistrySecurity = registryKey.GetAccessControl(AccessControlSections.Access);
Console.WriteLine("Updated Access Control List (ACL):");
Console.WriteLine(updatedRegistrySecurity.GetSecurityDescriptorSddlForm(AccessControlSections.Access));
Main Types
The main type provided by this library is:
Microsoft.Win32.RegistryAclExtensions
Additional Documentation
Feedback & Contributing
Microsoft.Win32.Registry.AccessControl is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- Microsoft.Win32.Registry (>= 5.0.0)
- System.Security.AccessControl (>= 6.0.0)
-
.NETStandard 2.0
- Microsoft.Win32.Registry (>= 5.0.0)
- System.Security.AccessControl (>= 6.0.0)
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (10)
Showing the top 5 NuGet packages that depend on Microsoft.Win32.Registry.AccessControl:
| Package | Downloads |
|---|---|
|
Microsoft.Windows.Compatibility
This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET as well as .NET Standard. |
|
|
System.Management.Automation
Runtime for hosting PowerShell |
|
|
Microsoft.PowerShell.SDK
Runtime for hosting PowerShell |
|
|
DiscUtils.Registry
DiscUtils Registry |
|
|
Microsoft.CST.AttackSurfaceAnalyzer
Microsoft Attack Surface Analyzer is an open source security tool that analyzes the attack surface of a target system and reports on potential security vulnerabilities introduced during the installation of software or system misconfiguration. This package contains the AttackSurfaceAnalyzer library. For the CLI Dotnet Tool, see Microsoft.CST.AttackSurfaceAnalyzer.CLI. |
GitHub repositories (4)
Showing the top 4 popular GitHub repositories that depend on Microsoft.Win32.Registry.AccessControl:
| Repository | Stars |
|---|---|
|
PowerShell/PowerShell
PowerShell for every system!
|
|
|
microsoft/AttackSurfaceAnalyzer
Attack Surface Analyzer can help you analyze your operating system's security configuration for changes during software installation.
|
|
|
DiscUtils/DiscUtils
Utility libraries to interact with discs, filesystem formats and more
|
|
|
mann1x/CPUDoc
|
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.0-preview.1.26104.118 | 562 | 2/10/2026 |
| 10.0.3 | 17,576 | 2/10/2026 |
| 10.0.2 | 74,789 | 1/13/2026 |
| 10.0.1 | 66,993 | 12/9/2025 |
| 10.0.0 | 89,655 | 11/11/2025 |
| 10.0.0-rc.2.25502.107 | 13,049 | 10/14/2025 |
| 10.0.0-rc.1.25451.107 | 14,273 | 9/9/2025 |
| 10.0.0-preview.7.25380.108 | 4,212 | 8/12/2025 |
| 10.0.0-preview.6.25358.103 | 1,414 | 7/15/2025 |
| 10.0.0-preview.5.25277.114 | 1,005 | 6/6/2025 |
| 10.0.0-preview.4.25258.110 | 1,901 | 5/12/2025 |
| 9.0.13 | 3,032 | 2/10/2026 |
| 9.0.12 | 13,495 | 1/13/2026 |
| 9.0.11 | 40,254 | 11/11/2025 |
| 9.0.10 | 432,092 | 10/14/2025 |
| 9.0.9 | 103,399 | 9/9/2025 |
| 9.0.8 | 184,106 | 8/4/2025 |
| 9.0.7 | 55,656 | 7/8/2025 |
| 9.0.6 | 342,973 | 6/10/2025 |
| 9.0.5 | 79,365 | 5/13/2025 |