Skip to content

Using private apis in nuget packages

Tim edited this page Aug 28, 2023 · 3 revisions

Since we don't provide any guarantees about private APIs being stable whatsoever, you need to pin the exact version of Avalonia in your package dependencies, like this:

<!-- enable private APIs -->
<AvaloniaAccessUnstablePrivateApis>true</AvaloniaAccessUnstablePrivateApis>

<!-- Mind to specify the exact Avalonia version needed for your package to work -->
<PackageReference Include="Avalonia" Version="[11.0.0]" />

To proceed with private API usage, add this to your project file:

<Avalonia_I_Want_To_Use_Private_Apis_In_Nuget_Package_And_Promise_To_Pin_The_Exact_Avalonia_Version_In_Package_Dependency>true</Avalonia_I_Want_To_Use_Private_Apis_In_Nuget_Package_And_Promise_To_Pin_The_Exact_Avalonia_Version_In_Package_Dependency>