Vanara.Core
5.0.1
Prefix Reserved
dotnet add package Vanara.Core --version 5.0.1
NuGet\Install-Package Vanara.Core -Version 5.0.1
<PackageReference Include="Vanara.Core" Version="5.0.1" />
<PackageVersion Include="Vanara.Core" Version="5.0.1" />
<PackageReference Include="Vanara.Core" />
paket add Vanara.Core --version 5.0.1
#r "nuget: Vanara.Core, 5.0.1"
#:package Vanara.Core@5.0.1
#addin nuget:?package=Vanara.Core&version=5.0.1
#tool nuget:?package=Vanara.Core&version=5.0.1
![]()
Vanara.Core NuGet Package
This library includes shared methods, structures and constants for use throughout the Vanara assemblies. Think of it as windows.h with some useful extensions. It includes:
- Extension methods for working with enumerated types (enum), FILETIME, and method and property extractions via reflection
- Extension and helper methods to marshaling structures arrays and strings
- SafeHandle based classes for working with memory allocated via CoTaskMem, HGlobal, or Local calls that handles packing and extracting arrays, structures and raw memory
- Safe pinning of objects in memory
- Memory stream based on marshaled memory
- IEnumerable helpers for COM enumerations
- Custom marshaler for CoTaskMem pointers
- Enhanced error results classes for HRESULT, Win32Error and NTStatus
- Standard windows.h macros (e.g. HIWORD, MAKELONG, etc.)
- Overlapped method wrapper
- Resource ID holder
What is Vanara?
Vanara is a community project that contains various .NET assemblies which have P/Invoke functions, interfaces, enums and structures from Windows libraries. Each assembly is associated with one or a few tightly related libraries.
Issues?
First check if it's already fixed by trying the MyGet build. If you're still running into problems, file an issue.
Included in Vanara.Core
| Classes | Structures | Enumerations | Interfaces |
|---|---|---|---|
| AddAsCtorAttribute AddAsMemberAttribute AdjustAutoMethodNamePatternAttribute AlignedMemory AnySizeStringMarshaler AppendedStringAttribute ArrayAttribute ArrayPointerAttribute AssociateAttribute AssociateStringAttribute AutoHandleAttribute AutoSafeHandleAttribute BeginEndEventContext BitFieldAttribute BitHelper ByteSizeFormatter ClipCorrespondingTypeAttribute CloseHandleFunc ComConnectionPoint ComEnumString ComReleaser ComReleaserFactory ComStream ComTryGetNext ComTypeExtensions ConstantConversionExtensions CorrespondingTypeAttribute CoTaskMemoryMethods CoTaskMemStringMarshaler DeferAutoMethodFromAttribute DisposingList EnumerableEqualityComparer EnumeratorToEnumVariantMarshaler EnumExtensions ErrorHelper EventedList FailedHelper FileTimeExtensions FixedStringAttribute Formatter FormatterComposer FunctionHelper GenericSafeHandle GenericStringMarshaler GenericStringMarshalerBase GenericVirtualReadOnlyDictionary GetNextDelegate GuidToStringMarshaler HANDLEConverter HexDumpHelpers HGlobalMemoryMethods History IArrayStructExtensions IArrayStructMarshaler IEnumeratorFromNext IEnumFromCom IEnumFromIndexer IEnumFromNext IgnoreAttribute IidFunc IidFunc IidFunc1 IidFunc1 IidFunc2 IidFunc2 IndirectResource IndirectString InteropExtensions IntPtrConverter IOExtensions Lib LibHelper LinqHelpers ListChangedEventArgs LOGPALETTE Macros MarshaledAlternativeAttribute MarshaledAttribute Marshaler MarshalerOptions MarshalException MarshalFieldAs MarshalHelper MarshalingStream Matrix Matrix MemoryMethodsBase NativeMemoryEnumerator NativeMemoryStream NullTermStringArrayMarshaler OverlappedAsync OverlappedAsyncResult OverloadResolutionPriorityAttribute PFILETIME PinnedObject PInvokeClientExtensions PInvokeDataAttribute PointerDefAttribute PRECT PSYSTEMTIME PtrFunc PtrFunc ReflectionExtensions ReflectionExtensions RegistryTypeExt SafeAllocatedMemoryHandle SafeAllocatedMemoryHandleBase SafeAnysizeStruct SafeAnysizeStructBase SafeAnysizeStructMarshaler SafeByteArray SafeCoTaskMemHandle SafeCoTaskMemString SafeCoTaskMemStruct SafeElementArray SafeGuidPtr SafeHANDLE SafeHGlobalHandle SafeHGlobalStruct SafeLPSTR SafeLPTSTR SafeLPWSTR SafeMemoryHandle SafeMemoryHandleExt SafeMemoryPool SafeMemString SafeMemStruct SafeNativeArray SafeNativeArrayBase SafeNativeLinkedList SafeNativeListBase SafeResourceId SBFunc SBFunc SBFunc SECURITY_ATTRIBUTES SizeDefAttribute SizeFieldNameAttributeExt SizeFunc SizeFunc SizeOfAttribute SpanAction SparseArray StaticFieldValueHash StringHelper StringPtrArrayMarshaler StructHelper StructPointer StructPointerAttribute StructPtrAttribute SuppressAutoGenAttribute TryGetDelegate TryGetNext TryGetNext TryGetValueDelegate TypeDefAttribute UnionHelper UntypedNativeMemoryEnumerator VanaraCustomMarshaler VanaraMarshaler VanaraMarshalerAttribute VirtualDictionary VirtualList VirtualListMethodCarrier VirtualReadOnlyDictionary VirtualReadOnlyList | ACCESS_MASK AnySizeStructFieldArray AnySizeStructUnmanagedFieldArray ArrayPointer BitField BOOL BOOLEAN BusNumber CLIPFORMAT CM_FULL_RESOURCE_DESCRIPTOR CM_PARTIAL_RESOURCE_DESCRIPTOR CM_PARTIAL_RESOURCE_LIST CM_POWER_DATA CM_RESOURCE_LIST COLORREF Connection CORRELATION_VECTOR CY DATE DECIMAL DEVICE_CAPABILITIES DevicePrivate DeviceSpecificData DEVMODE Dma DmaV3 EnumFlagIndexer EnumRebase FOURCC Generic GuidPtr HACCEL HANDLE HBITMAP HBRUSH HCOLORSPACE HCURSOR HDC HDPA HDROP HDSA HDWP HENHMETAFILE HEVENT HFILE HFONT HGDIOBJ HICON HIMAGELIST HINSTANCE HKEY HMENU HMETAFILE HMONITOR HPALETTE HPEN HPROCESS HPROPSHEET HPROPSHEETPAGE HRESULT HRGN HSECTION HTASK HTHEME HTHREAD HTHUMBNAIL HTOKEN HWND Interrupt IUnknownPointer LANGID LCID LOGFONT LOGPALETTE LPCSTRArrayPointer LPCTSTRArrayPointer LPCWSTRArrayPointer LUID ManagedArrayPointer ManagedStructPointer Memory40 Memory48 Memory64 MessageInterruptRaw MSG NTStatus OBJECT_TYPE_LIST OFSTRUCT PACE PACL PALETTEENTRY PFILETIME POINT POINTS PRECT PSECURITY_DESCRIPTOR PSID PSYSTEMTIME RECT RefEnumerator RefEnumeratorEx ResourceId ResourceIdOrHandle RGBQUAD SECURITY_ATTRIBUTES SIZE SizeT StrPtrAnsi StrPtrAuto StrPtrUni StructPointer SYSTEMTIME tagSECURITY_ATTRIBUTES TEXTMETRIC time_t Union WIN32_FIND_DATA Win32Error | ArrayLayout Bitness CharacterSet CM_DEVCAP CM_FILE CM_INSTALL_STATE CM_REMOVAL_POLICY CM_RESOURCE CM_SHARE_DISPOSITION CmResourceType CONFIGFLAG CorrespondingAction DEVICE_POWER_STATE DEVICE_SCALE_FACTOR DMCOLLATE DMCOLOR DMDFO DMDISPLAY DMDITHER DMDO DMDUP DMFIELDS DMICM DMICMMETHOD DMMEDIA DMNUP DMORIENT DMPAPER DMRES DMTT DN DrawTextFlags ExcludeOptions FacilityCode FacilityCode FILE_ATTRIBUTE FILE_DEVICE FILE_FLAG FILE_SECURITY FILE_SHARE FileAttributeConstant FileFlagsAndAttributes FileOpConstant FilePermissionConstant FontFamily FontPitch INTERFACE_TYPE LANG LayoutModel LogFontClippingPrecision LogFontOutputPrecision LogFontOutputQuality MouseButtonState NTDDI ObjectTypeListLevel PC PDCAP PInvokeClient POOL_TYPE ProcessorArchitecture REG_VALUE_TYPE ResourceType SECURITY_INFORMATION SeverityLevel SeverityLevel ShowWindowCommand SizingMethod SORT STGM StringEncoding StringListPackMethod SUBLANG SYSTEM_POWER_STATE SystemColorIndex SystemShutDownReason URLZONE WIN32_WINNT | IArrayStruct IClipboardFormatter ICOMEnum IDeviceContextHandle IErrorProvider IErrorProvider2 IGetMemorySize IGraphicsObjectHandle IHandle IHistory IKernelHandle IMemoryHandle IMemoryMethods ISafeMemoryHandle ISafeMemoryHandleBase ISafeMemoryHandleFactory ISecurityObject IShellHandle ISimpleMemoryMethods ISupportIndexer ISyncHandle IUserHandle IVanaraMarshaler IVirtualListMethods IVirtualReadOnlyListMethods |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. 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 is compatible. 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 was computed. 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. net8.0-windows7.0 is compatible. net9.0 was computed. 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. net9.0-windows7.0 is compatible. net10.0 was computed. 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. net10.0-windows7.0 is compatible. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. 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. |
-
.NETCoreApp 3.1
- Microsoft.Win32.Registry (>= 5.0.0)
- System.Security.AccessControl (>= 6.0.1)
-
.NETFramework 4.8
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Memory (>= 4.6.3)
-
.NETStandard 2.0
- Microsoft.Win32.Registry (>= 5.0.0)
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Memory (>= 4.6.3)
- System.Security.AccessControl (>= 6.0.1)
-
.NETStandard 2.1
- Microsoft.Win32.Registry (>= 5.0.0)
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
- System.Security.AccessControl (>= 6.0.1)
-
net10.0-windows7.0
- No dependencies.
-
net5.0
- No dependencies.
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0-windows7.0
- No dependencies.
-
net9.0-windows7.0
- No dependencies.
NuGet packages (138)
Showing the top 5 NuGet packages that depend on Vanara.Core:
| Package | Downloads |
|---|---|
|
Vanara.PInvoke.Shared
Shared methods, structures and constants for use throughout the Vanara.PInvoke assemblies. Includes: * IEnumerable helpers for COM enumerations * Custom marshaler for CoTaskMem pointers * Enhanced error results classes for HRESULT, Win32Error and NTStatus * Standard windows.h macros (e.g. HIWORD, MAKELONG, etc.) * Overlapped method wrapper * Resource ID holder * Shared structures and enums (see release notes) |
|
|
Vanara.PInvoke.Kernel32
PInvoke API (methods, structures and constants) imported from Windows Kernel32.dll. |
|
|
Vanara.PInvoke.Cryptography
PInvoke API (methods, structures and constants) imported from Windows crypt32.dll, bcrypt.dll, ncrypt.dll, tokenbinding.dll, cryptnet.dll, cryptdlg.dll and cryptui.dll. |
|
|
Vanara.PInvoke.Security
PInvoke API (methods, structures and constants) imported from Windows AdvApi32.dll, Authz.dll, sspicli.dll, schannel.dll, tdh.dll and Secur32.dll. |
|
|
Vanara.PInvoke.Gdi32
PInvoke API (methods, structures and constants) imported from Windows Gdi32.dll |
GitHub repositories (4)
Showing the top 4 popular GitHub repositories that depend on Vanara.Core:
| Repository | Stars |
|---|---|
|
omeryanar/FileExplorer
Windows File Explorer alternative with tab browsing
|
|
|
zhupingqi/RuiJi.Net
crawler framework, distributed crawler extractor
|
|
|
zqhong/RyzenTuner
A tool that supports adjusting the power limit of Ryzen mobile processors and the QoS level and priority of Windows processes
|
|
|
NeilMacMullen/kusto-loco
C# KQL query engine with flexible I/O layers and visualization
|
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 5.0.1 | 0 | 3/11/2026 | |
| 5.0.0 | 58,710 | 1/12/2026 | |
| 4.2.1 | 198,719 | 9/9/2025 | |
| 4.2.0 | 15,688 | 8/25/2025 | |
| 4.1.6 | 109,956 | 6/20/2025 | |
| 4.1.5 | 3,809 | 6/20/2025 | |
| 4.1.4 | 26,501 | 6/7/2025 | |
| 4.1.3 | 78,114 | 4/24/2025 | |
| 4.1.2 | 28,127 | 4/16/2025 | |
| 4.1.1 | 69,612 | 3/7/2025 | |
| 4.1.0 | 4,988 | 3/7/2025 | |
| 4.0.6 | 21,766 | 2/24/2025 | |
| 4.0.5 | 17,301 | 2/8/2025 | |
| 4.0.4 | 229,997 | 9/13/2024 | |
| 4.0.3 | 175,892 | 8/5/2024 | |
| 4.0.2 | 47,283 | 6/24/2024 | |
| 4.0.1 | 143,330 | 4/30/2024 | |
| 4.0.0 | 36,891 | 3/29/2024 | |
| 4.0.0-beta2 | 6,841 | 1/22/2024 | |
| 4.0.0-beta | 7,783 | 11/20/2023 |
Currently implements:
Classes
AddAsCtorAttribute, AddAsMemberAttribute, AdjustAutoMethodNamePatternAttribute, AlignedMemory<T>, AnySizeStringMarshaler<T>, AppendedStringAttribute, ArrayAttribute, ArrayPointerAttribute, AssociateAttribute, AssociateStringAttribute, AutoHandleAttribute, AutoSafeHandleAttribute, BeginEndEventContext, BitFieldAttribute<T>, BitHelper, ByteSizeFormatter, ClipCorrespondingTypeAttribute, CloseHandleFunc, ComConnectionPoint, ComEnumString, ComReleaser<T>, ComReleaserFactory, ComStream, ComTryGetNext, ComTypeExtensions, ConstantConversionExtensions, CorrespondingTypeAttribute, CoTaskMemoryMethods, CoTaskMemStringMarshaler, DeferAutoMethodFromAttribute, DisposingList, EnumerableEqualityComparer<T>, EnumeratorToEnumVariantMarshaler, EnumExtensions, ErrorHelper, EventedList<T>, FailedHelper, FileTimeExtensions, FixedStringAttribute, Formatter, FormatterComposer, FunctionHelper, GenericSafeHandle, GenericStringMarshaler<T>, GenericStringMarshalerBase<T>, GenericVirtualReadOnlyDictionary<T>, GetNextDelegate, GuidToStringMarshaler, HANDLEConverter, HexDumpHelpers, HGlobalMemoryMethods, History<T>, IArrayStructExtensions, IArrayStructMarshaler<T>, IEnumeratorFromNext<T>, IEnumFromCom<T>, IEnumFromIndexer<T>, IEnumFromNext<T>, IgnoreAttribute, IidFunc, IidFunc<T>, IidFunc1<T>, IidFunc1<T>, IidFunc2<T>, IidFunc2<T>, IndirectResource, IndirectString, InteropExtensions, IntPtrConverter, IOExtensions, Lib, LibHelper, LinqHelpers, ListChangedEventArgs<T>, LOGPALETTE, Macros, MarshaledAlternativeAttribute, MarshaledAttribute, Marshaler, MarshalerOptions, MarshalException, MarshalFieldAs, MarshalHelper, MarshalingStream, Matrix, Matrix<T>, MemoryMethodsBase, NativeMemoryEnumerator<T>, NativeMemoryStream, NullTermStringArrayMarshaler, OverlappedAsync, OverlappedAsyncResult, OverloadResolutionPriorityAttribute, PFILETIME, PinnedObject, PInvokeClientExtensions, PInvokeDataAttribute, PointerDefAttribute, PRECT, PSYSTEMTIME, PtrFunc<T>, PtrFunc<T>, ReflectionExtensions, ReflectionExtensions, RegistryTypeExt, SafeAllocatedMemoryHandle, SafeAllocatedMemoryHandleBase, SafeAnysizeStruct<T>, SafeAnysizeStructBase<T>, SafeAnysizeStructMarshaler<T>, SafeByteArray, SafeCoTaskMemHandle, SafeCoTaskMemString, SafeCoTaskMemStruct<T>, SafeElementArray<T>, SafeGuidPtr, SafeHANDLE, SafeHGlobalHandle, SafeHGlobalStruct<T>, SafeLPSTR, SafeLPTSTR, SafeLPWSTR, SafeMemoryHandle<T>, SafeMemoryHandleExt<T>, SafeMemoryPool<T>, SafeMemString<T>, SafeMemStruct<T>, SafeNativeArray<T>, SafeNativeArrayBase<T>, SafeNativeLinkedList<T>, SafeNativeListBase<T>, SafeResourceId, SBFunc<T>, SBFunc<T>, SBFunc<T>, SECURITY_ATTRIBUTES, SizeDefAttribute, SizeFieldNameAttributeExt, SizeFunc<T>, SizeFunc<T>, SizeOfAttribute, SpanAction, SparseArray<T>, StaticFieldValueHash, StringHelper, StringPtrArrayMarshaler, StructHelper, StructPointer, StructPointerAttribute, StructPtrAttribute, SuppressAutoGenAttribute, TryGetDelegate, TryGetNext<T>, TryGetNext<T>, TryGetValueDelegate, TypeDefAttribute, UnionHelper, UntypedNativeMemoryEnumerator, VanaraCustomMarshaler<T>, VanaraMarshaler, VanaraMarshalerAttribute, VirtualDictionary<T>, VirtualList<T>, VirtualListMethodCarrier<T>, VirtualReadOnlyDictionary<T>, VirtualReadOnlyList<T>
Structures
ACCESS_MASK, AnySizeStructFieldArray<T>, AnySizeStructUnmanagedFieldArray<T>, ArrayPointer<T>, BitField<T>, BOOL, BOOLEAN, BusNumber, CLIPFORMAT, CM_FULL_RESOURCE_DESCRIPTOR, CM_PARTIAL_RESOURCE_DESCRIPTOR, CM_PARTIAL_RESOURCE_LIST, CM_POWER_DATA, CM_RESOURCE_LIST, COLORREF, Connection, CORRELATION_VECTOR, CY, DATE, DECIMAL, DEVICE_CAPABILITIES, DevicePrivate, DeviceSpecificData, DEVMODE, Dma, DmaV3, EnumFlagIndexer<T>, EnumRebase<T>, FOURCC, Generic, GuidPtr, HACCEL, HANDLE, HBITMAP, HBRUSH, HCOLORSPACE, HCURSOR, HDC, HDPA, HDROP, HDSA, HDWP, HENHMETAFILE, HEVENT, HFILE, HFONT, HGDIOBJ, HICON, HIMAGELIST, HINSTANCE, HKEY, HMENU, HMETAFILE, HMONITOR, HPALETTE, HPEN, HPROCESS, HPROPSHEET, HPROPSHEETPAGE, HRESULT, HRGN, HSECTION, HTASK, HTHEME, HTHREAD, HTHUMBNAIL, HTOKEN, HWND, Interrupt, IUnknownPointer<T>, LANGID, LCID, LOGFONT, LOGPALETTE, LPCSTRArrayPointer, LPCTSTRArrayPointer, LPCWSTRArrayPointer, LUID, ManagedArrayPointer<T>, ManagedStructPointer<T>, Memory40, Memory48, Memory64, MessageInterruptRaw, MSG, NTStatus, OBJECT_TYPE_LIST, OFSTRUCT, PACE, PACL, PALETTEENTRY, PFILETIME, POINT, POINTS, PRECT, PSECURITY_DESCRIPTOR, PSID, PSYSTEMTIME, RECT, RefEnumerator<T>, RefEnumeratorEx<T>, ResourceId, ResourceIdOrHandle<T>, RGBQUAD, SECURITY_ATTRIBUTES, SIZE, SizeT, StrPtrAnsi, StrPtrAuto, StrPtrUni, StructPointer<T>, SYSTEMTIME, tagSECURITY_ATTRIBUTES, TEXTMETRIC, time_t, Union, WIN32_FIND_DATA, Win32Error
Enumerations
ArrayLayout, Bitness, CharacterSet, CM_DEVCAP, CM_FILE, CM_INSTALL_STATE, CM_REMOVAL_POLICY, CM_RESOURCE, CM_SHARE_DISPOSITION, CmResourceType, CONFIGFLAG, CorrespondingAction, DEVICE_POWER_STATE, DEVICE_SCALE_FACTOR, DMCOLLATE, DMCOLOR, DMDFO, DMDISPLAY, DMDITHER, DMDO, DMDUP, DMFIELDS, DMICM, DMICMMETHOD, DMMEDIA, DMNUP, DMORIENT, DMPAPER, DMRES, DMTT, DN, DrawTextFlags, ExcludeOptions, FacilityCode, FacilityCode, FILE_ATTRIBUTE, FILE_DEVICE, FILE_FLAG, FILE_SECURITY, FILE_SHARE, FileAttributeConstant, FileFlagsAndAttributes, FileOpConstant, FilePermissionConstant, FontFamily, FontPitch, INTERFACE_TYPE, LANG, LayoutModel, LogFontClippingPrecision, LogFontOutputPrecision, LogFontOutputQuality, MouseButtonState, NTDDI, ObjectTypeListLevel, PC, PDCAP, PInvokeClient, POOL_TYPE, ProcessorArchitecture, REG_VALUE_TYPE, ResourceType, SECURITY_INFORMATION, SeverityLevel, SeverityLevel, ShowWindowCommand, SizingMethod, SORT, STGM, StringEncoding, StringListPackMethod, SUBLANG, SYSTEM_POWER_STATE, SystemColorIndex, SystemShutDownReason, URLZONE, WIN32_WINNT