- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 blazor 服务器应用程序,它是使用 AWS Beanstalk 在 AWS 上部署的 .Net 5.0 应用程序。这是一个单实例部署,所以我目前无法使用负载平衡(由于当前给我的限制)。部署的环境平台为“IIS 10.0 running on 64bit Windows Server Core 2019/2.6.3”。当我在 VS2019 和本地 iis 服务器上本地运行它时,该应用程序运行良好。但是一旦部署,它会在浏览器控制台中引发错误:
blazor.server.js:1 [2021-02-19T17:17:03.896Z] Error: Failed to start the transport 'LongPolling': Error
e.log @ blazor.server.js:1
blazor.server.js:1 [2021-02-19T17:17:03.897Z] Error: Failed to start the connection: Error: Unable to connect to the server with any of the available transports. ServerSentEvents failed: Error: 'ServerSentEvents' does not support Binary. LongPolling failed: Error
e.log @ blazor.server.js:1
blazor.server.js:19 [2021-02-19T17:17:03.897Z] Error: Error: Unable to connect to the server with any of the available transports. ServerSentEvents failed: Error: 'ServerSentEvents' does not support Binary. LongPolling failed: Error
e.log @ blazor.server.js:19
blazor.server.js:1 Uncaught (in promise) Error: Cannot send data if the connection is not in the 'Connected' State.
at e.send (blazor.server.js:1)
at e.sendMessage (blazor.server.js:1)
at e.sendWithProtocol (blazor.server.js:1)
at blazor.server.js:1
at new Promise (<anonymous>)
at e.invoke (blazor.server.js:1)
at e.<anonymous> (blazor.server.js:19)
at blazor.server.js:19
at Object.next (blazor.server.js:19)
at blazor.server.js:19
_host.cshtml
@page "/"
@namespace Space
@{
Layout = null;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>UI</title>
<base href="~/" />
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
<link href="css/site.css" rel="stylesheet" />
<link href="_content/MatBlazor/dist/matBlazor.css" rel="stylesheet" />
<!--Blazorise Stuff -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css">
<link href="_content/Blazorise/blazorise.css" rel="stylesheet" />
<link href="_content/Blazorise.Bootstrap/blazorise.bootstrap.css" rel="stylesheet" />
</head>
<body>
<component type="typeof(App)" render-mode="ServerPrerendered" />
<div id="blazor-error-ui">
<environment include="Staging,Production">
An error has occurred. This application may no longer respond until reloaded.
</environment>
<environment include="Development">
An unhandled exception has occurred. See browser dev tools for details.
</environment>
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.server.js"></script>
<script src="_content/MatBlazor/dist/matBlazor.js"></script>
<!-- blazorise stuff -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
<script src="_content/Blazorise/blazorise.js"></script>
<script src="_content/Blazorise.Bootstrap/blazorise.bootstrap.js"></script>
<!-- Workarounds -->
<script src="~/workaround-gradient.js"></script>
</body>
</html>
The startup file
namespace Space
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
var connectionString = AwsParameterStore.GetValue(AwsParameters.AwsConnectString) ??
Configuration.GetConnectionString("DefaultConnection");
services.AddDbContext<UiContext>(options =>
options.UseSqlServer(connectionString));
ConfigureIdentityStuff(services);
services.AddServerSideBlazor();
services.AddScoped<AuthenticationStateProvider, RevalidatingIdentityAuthenticationStateProvider<UiUser>>();
services.AddDatabaseDeveloperPageExceptionFilter();
services.AddBlazorDownloadFile();
services.AddScoped<HttpClient>();
services.AddBlazorise();
services.AddBootstrapProviders();
services.AddFontAwesomeIcons();
services.AddSignalRCore();
}
private void ConfigureIdentityStuff(IServiceCollection services)
{
services.AddDefaultIdentity<UiUser>(options =>
{
options.SignIn.RequireConfirmedAccount = false;
// Password settings.
options.Password.RequireDigit = true;
options.Password.RequireLowercase = true;
options.Password.RequireNonAlphanumeric = true;
options.Password.RequireUppercase = true;
options.Password.RequiredLength = UserRelatedStaticConstDefaults.DefaultMinimumPasswordLength;
options.Password.RequiredUniqueChars = 1;
// Lockout settings.
options.Lockout.DefaultLockoutTimeSpan = UserRelatedStaticConstDefaults.DefaultLockoutTime;
options.Lockout.MaxFailedAccessAttempts = 5;
options.Lockout.AllowedForNewUsers = true;
// User settings.
options.User.AllowedUserNameCharacters =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._@+";
options.User.RequireUniqueEmail = true;
})
.AddRoles<IdentityRole>()
.AddEntityFrameworkStores<UiContext>();
services.ConfigureApplicationCookie(options =>
{
// Cookie settings
options.Cookie.HttpOnly = true;
options.ExpireTimeSpan = TimeSpan.FromMinutes(10);
options.LoginPath = "/Identity/Account/Login";
options.AccessDeniedPath = "/Identity/Account/AccessDenied";
options.SlidingExpiration = true;
});
services.TryAddSingleton<IActionContextAccessor, ActionContextAccessor>();
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
services.AddRazorPages(options =>
{
options.Conventions.AuthorizeFolder("/Manage");
});
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseMigrationsEndPoint();
}
else
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.ApplicationServices
.UseBootstrapProviders()
.UseFontAwesomeIcons();
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
endpoints.MapBlazorHub();
endpoints.MapRazorPages();
endpoints.MapFallbackToPage("/_Host");
});
}
}
}
My _Imports.razor
@using System.Net.Http
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using Space
@using Space.Pages
@using Space.Shared
@using Space.Shared.DataInput
@using Space.Shared.OutputData
@using MatBlazor
@using MatBlazor.Components
@using MatBlazor.Components.MatAutocompleteList
@using ReactiveUI.Blazor
@using Blazorise
@using Blazorise.Components
@attribute [Authorize]
我不知道发生了什么。我尝试查找它,但在多个建议/答案之后我一无所获。有人可以帮忙吗!
最佳答案
Blazor 需要 Websocket。在 windows beanstalk 环境中,它显然默认是禁用的。
我使用这个 pre-defined config from aws 启用了它们.
commands:
InstallWebsocket:
command: powershell.exe Install-WindowsFeature -name Web-WebSockets
EnableWebsocket:
command: 'C:\windows\system32\inetsrv\appcmd.exe set config "Default Web Site" -section:system.webServer/webSocket /enabled:"True" /receiveBufferLimit:"4194304" /pingInterval:"00:00:10" /commit:apphost'
将此配置放入
.ebextensions
文件夹,一切正常。
关于c# - 在 AWS "Error: Cannot send data if the connection is not in the ' Connected'State 上部署了 blazor 服务器应用程序。”但适用于本地主机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66294337/
我正在编写一个简单的有限状态机,并意识到在某些情况下,事件可以将状态变为多个可能的结果。基本上,从状态 A,如果事件 E 发生,状态可能是 C 或 D。 我目前正在使用此处编写的 Javascript
我在 React 中构建了一个应用程序,我在其中一个样板项目中找到了一行。 (state = {}) => state 谁能给我解释一下上面这行是什么意思?它是 javascript ES6 标准。
如何将多个状态变量组合成另一个? 我想通过一些用户交互来更改高度或宽度的值,并相应地更新 View 中的所有内容。所以高度或宽度会改变,面积也会改变。 我想它看起来像这样 @State var wid
我的容器正在通过 redux store 获取状态。 我通过这样的 Prop 将这个状态传递给模态框:示例: render(){ let {team,id} =this.props.data;
您好,我正在尝试使用 map 根据我所在状态的数组渲染选项,但在返回中使用它时我得到未定义 这是数组 this.state = { countries: ["Australia","Brazil"
我想将 this.state.currentPlayer 分配给 this.state.whosPlaying。它抛出错误TypeError:无法读取新板上未定义的属性“currentPlayer”。
我正在实现某种动态工作流程,当达到某个点时,我必须重新加载状态以呈现 HTML 并重新实例化 Controller 才能继续。 我发现我第二次调用 $state.reload() 不起作用。这是期望的
我正在开发一个 flutter 应用程序,并发现状态管理出现意外行为。我创建了一个示例应用来重现该行为,您可以在下面找到代码和日志输出。 该应用程序包含一个简单的 ListView,其中包含 10 个
有人可以举一个简单的例子,其中 state monad 比直接传递 state 更好吗? bar1 (Foo x) = Foo (x + 1) 对比 bar2 :: State Foo Foo bar
我想写类似 $state.go("/spheres/{{$stateParams.sphereId}}/mono/view"); 的内容使用外部 url 而不是状态,但这不起作用:( 现在我明白为什么
我正在使用“angular-ui-tree”:“^2.22.5” 点击执行某事菜单项时出错.. TypeError: this.$state is undefined 如何将对 $state 的引用传
我在elasticsearch中有文本字段,我想在kibana上可视化词云... 第一步,我们需要标记它们,我使用了“标准标记器” ... 使用这种形式的词云可视化结果如下图所示: 但是我需要的是专有
我正在尝试以编程方式在状态之间移动(使用 ui.router),而用户无需单击任何内容。文档位于 http://angular-ui.github.io/ui-router/site/#/api/ui
我想编写像“(event, state) -> state”这样的折叠函数。如果Java中没有任何模式匹配且不可变,我该如何编写它? 最佳答案 我认为您正在寻找 Java 中的函数式编程。 此版本中引
这个问题已经有答案了: What does an exclamation mark before a variable mean in JavaScript (4 个回答) 已关闭 8 年前。 您好,
https://plnkr.co/edit/bOZW1a9u62W1QA6cYjYj?p=preview 预期 登录后,所有 $states 都会初始化,然后单击 Ticker 按钮后,唯一应重新初始
试图决定(针对我的应用程序)在 onPause() 中保存什么以及要保存在 onSaveInstanceState() 中的内容,我梳理了整个 SO 以获得提示和明确的指导方针。 如果我没理解错的话,
在 Javascript 中,当我单击滚动条(页面中出现的任何滚动条)并将鼠标悬停在图像上时,图像再次开始拖动。 图像只能在鼠标按钮按下状态下拖动。 所以我试图通过了解鼠标按钮状态(mousedown
我见过 Maybe和 Either在代码中使用仿函数(和应用)是有道理的,但我很难想出一个 State 的例子。仿函数和应用。也许它们不是很有用,只是因为 State 才存在。 monad 需要一个仿
我非常努力地想围绕 State Monad,但我不明白以下内容: 鉴于 return 的实现和 (>>=) ,当你说 State $ \s ->.... ,在哪里s来自?我的意思是,当你开始表演时 >
我是一名优秀的程序员,十分优秀!