Migrate to .NET Admin SDK v2
Stay organized with collections
Save and categorize content based on your preferences.
Firebase Admin SDK for .NET v2.0.0 introduces some breaking changes that may
affect your application code. Review this guide, and make changes as necessary.
Update target frameworks
The Admin SDK no longer supports netstandard1.5
and net45
target framework monikers.
Instead, use netstandard2.0
, net461
or higher.
Update code that uses the PagedAsyncEnumerable
class
The Admin SDK provides several APIs that return instances of
PagedAsyncEnumerable
. This class provides a way to iterate through a
sequence of items either one entry at a time or by pages. Because the Admin SDK
is upgrading its dependency on the Google.Api.Gax
package, you'll need to
update code that uses the PageAsyncEnumerable
class as follows:
Before
var pagedEnumerable = FirebaseAuth.DefaultInstance.ListUsersAsync(null);
var responses = pagedEnumerable.AsRawResponses().GetEnumerator();
while (await responses.MoveNext())
{
ExportedUserRecords response = responses.Current;
foreach (ExportedUserRecord user in response.Users)
{
Console.WriteLine($"User: {user.Uid}");
}
}
var enumerator = FirebaseAuth.DefaultInstance.ListUsersAsync(null).GetEnumerator();
while (await enumerator.MoveNext())
{
ExportedUserRecord user = enumerator.Current;
Console.WriteLine($"User: {user.Uid}");
}
After
var pagedEnumerable = FirebaseAuth.DefaultInstance.ListUsersAsync(null);
var responses = pagedEnumerable.AsRawResponses().GetAsyncEnumerator();
while (await responses.MoveNextAsync())
{
ExportedUserRecords response = responses.Current;
foreach (ExportedUserRecord user in response.Users)
{
Console.WriteLine($"User: {user.Uid}");
}
}
var enumerator = FirebaseAuth.DefaultInstance.ListUsersAsync(null).GetAsyncEnumerator();
while (await enumerator.MoveNextAsync())
{
ExportedUserRecord user = enumerator.Current;
Console.WriteLine($"User: {user.Uid}");
}
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-28 UTC.
[null,null,["Last updated 2025-08-28 UTC."],[],[],null,["Firebase Admin SDK for .NET v2.0.0 introduces some breaking changes that may\naffect your application code. Review this guide, and make changes as necessary.\n\nUpdate target frameworks\n\nThe Admin SDK no longer supports `netstandard1.5` and `net45`\n[target framework monikers](https://docs.microsoft.com/en-us/dotnet/standard/frameworks).\nInstead, use `netstandard2.0`, `net461` or higher.\n\nUpdate code that uses the `PagedAsyncEnumerable` class\n\nThe Admin SDK provides several APIs that return instances of\n`PagedAsyncEnumerable`. This class provides a way to iterate through a\nsequence of items either one entry at a time or by pages. Because the Admin SDK\nis upgrading its dependency on the `Google.Api.Gax` package, you'll need to\nupdate code that uses the `PageAsyncEnumerable` class as follows:\n\n**Before** \n\n var pagedEnumerable = FirebaseAuth.DefaultInstance.ListUsersAsync(null);\n var responses = pagedEnumerable.AsRawResponses().GetEnumerator();\n while (await responses.MoveNext())\n {\n ExportedUserRecords response = responses.Current;\n foreach (ExportedUserRecord user in response.Users)\n {\n Console.WriteLine($\"User: {user.Uid}\");\n }\n }\n\n var enumerator = FirebaseAuth.DefaultInstance.ListUsersAsync(null).GetEnumerator();\n while (await enumerator.MoveNext())\n {\n ExportedUserRecord user = enumerator.Current;\n Console.WriteLine($\"User: {user.Uid}\");\n }\n\n**After** \n\n var pagedEnumerable = FirebaseAuth.DefaultInstance.ListUsersAsync(null);\n var responses = pagedEnumerable.AsRawResponses().GetAsyncEnumerator();\n while (await responses.MoveNextAsync())\n {\n ExportedUserRecords response = responses.Current;\n foreach (ExportedUserRecord user in response.Users)\n {\n Console.WriteLine($\"User: {user.Uid}\");\n }\n }\n\n var enumerator = FirebaseAuth.DefaultInstance.ListUsersAsync(null).GetAsyncEnumerator();\n while (await enumerator.MoveNextAsync())\n {\n ExportedUserRecord user = enumerator.Current;\n Console.WriteLine($\"User: {user.Uid}\");\n }"]]