YOURAPPLICATION.exe应替换为您的应用程序的名称。 5. 如果您的应用程序使用了自定义身份验证,则可能需要手动设置身份验证Cookie。您可以通过以下代码来实现此功能:
await _httpContextAccessor.HttpContext.SignInAsync("MyCookieAuthenticationScheme", principal, new AuthenticationProperties { ExpiresUtc = DateTimeOffset.UtcNow.AddMinutes(30), IsPersistent = false, AllowRefresh = false });
services.AddSignalR().AddJsonProtocol(options =>
{
options.PayloadSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
}).AddHubOptions