MissingMethodException: метод не найден: «Boolean Microsoft.AspNetCore.Cryptography.UnsafeNativeMethods.CryptProtectDataC#

Место общения программистов C#
Anonymous
MissingMethodException: метод не найден: «Boolean Microsoft.AspNetCore.Cryptography.UnsafeNativeMethods.CryptProtectData

Сообщение Anonymous »

Помогите мне устранить эту ошибку при запуске проекта ASP.NET.

Код: Выделить всё

MissingMethodException: Method not found: 'Boolean Microsoft.AspNetCore.Cryptography.UnsafeNativeMethods.CryptProtectData(Microsoft.AspNetCore.Cryptography.DATA_BLOB*, IntPtr, Microsoft.AspNetCore.Cryptography.DATA_BLOB*, IntPtr, IntPtr, UInt32, Microsoft.AspNetCore.Cryptography.DATA_BLOB ByRef)'.
когда я использую для входа в свой проект .net 6, не могу загрузить макет, помогите мне.
Изображение

Login.cshtml

Код: Выделить всё



Email






Mật Khẩu





Đăng Nhập



Контроллер учетной записи

Код: Выделить всё

[HttpPost]
public async Task Login(string username, string password, string ReturnUrl)
{
if ((username == "Admin@gmail.com") && (password == "Admin"))
{
var claims = new List
{
new Claim(ClaimTypes.Name, username)
};

var claimsIdentity = new ClaimsIdentity(claims, "Login");

await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(claimsIdentity));
return RedirectToAction("Index", "Home");
}
else
return View();
}
Надеюсь найти хорошее решение

Подробнее здесь: https://stackoverflow.com/questions/759 ... e-cryptogr

Вернуться в «C#»