diff --git a/src/Identity/UI/ref/Microsoft.AspNetCore.Identity.UI.csproj b/src/Identity/UI/ref/Microsoft.AspNetCore.Identity.UI.csproj
index 51b7eca6c4..813c7c4dff 100644
--- a/src/Identity/UI/ref/Microsoft.AspNetCore.Identity.UI.csproj
+++ b/src/Identity/UI/ref/Microsoft.AspNetCore.Identity.UI.csproj
@@ -5,7 +5,6 @@
-
diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/Manage/DownloadPersonalData.cshtml.cs b/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/Manage/DownloadPersonalData.cshtml.cs
index 5152d01e35..d0fdadaf93 100644
--- a/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/Manage/DownloadPersonalData.cshtml.cs
+++ b/src/Identity/UI/src/Areas/Identity/Pages/V3/Account/Manage/DownloadPersonalData.cshtml.cs
@@ -5,11 +5,11 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
-using Newtonsoft.Json;
namespace Microsoft.AspNetCore.Identity.UI.V3.Pages.Account.Manage.Internal
{
@@ -79,7 +79,7 @@ namespace Microsoft.AspNetCore.Identity.UI.V3.Pages.Account.Manage.Internal
personalData.Add($"Authenticator Key", await _userManager.GetAuthenticatorKeyAsync(user));
Response.Headers.Add("Content-Disposition", "attachment; filename=PersonalData.json");
- return new FileContentResult(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(personalData)), "text/json");
+ return new FileContentResult(JsonSerializer.SerializeToUtf8Bytes(personalData), "application/json");
}
}
}
diff --git a/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Manage/DownloadPersonalData.cshtml.cs b/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Manage/DownloadPersonalData.cshtml.cs
index 8529e3b171..38d077f014 100644
--- a/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Manage/DownloadPersonalData.cshtml.cs
+++ b/src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Manage/DownloadPersonalData.cshtml.cs
@@ -5,11 +5,11 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
-using Newtonsoft.Json;
namespace Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Manage.Internal
{
@@ -79,7 +79,7 @@ namespace Microsoft.AspNetCore.Identity.UI.V4.Pages.Account.Manage.Internal
personalData.Add($"Authenticator Key", await _userManager.GetAuthenticatorKeyAsync(user));
Response.Headers.Add("Content-Disposition", "attachment; filename=PersonalData.json");
- return new FileContentResult(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(personalData)), "text/json");
+ return new FileContentResult(JsonSerializer.SerializeToUtf8Bytes(personalData), "application/json");
}
}
}
diff --git a/src/Identity/UI/src/Microsoft.AspNetCore.Identity.UI.csproj b/src/Identity/UI/src/Microsoft.AspNetCore.Identity.UI.csproj
index d803f42f5a..f5a122a355 100644
--- a/src/Identity/UI/src/Microsoft.AspNetCore.Identity.UI.csproj
+++ b/src/Identity/UI/src/Microsoft.AspNetCore.Identity.UI.csproj
@@ -36,7 +36,6 @@
-