运行 Asp.Net Core 1.1
大多数情况下,无论启动过程中发生什么,我都希望我的 ASP.NET Core 应用程序运行,但是在启动过程中存在一些我希望它关闭的严重错误。在 Startup.cs 中,我尝试在 Configure 方法期间将 ApplicationLifetime 传递到 ApplicationStarted 事件中:
appLifetime.ApplicationStarted.Register((al) => {
var appLtime = (IApplicationLifetime)al;
try {
... various startup code....
} catch (Exception ex) {
appLtime.StopApplication();
}
}, appLifetime);
Run Code Online (Sandbox Code Playgroud)
但这结束抛出这个错误:
未处理的异常:System.ObjectDisposedException:CancellationTokenSource 已被处理。在 System.Threading.CancellationTokenSource.ThrowObjectDisposedException() 在 Microsoft.AspNetCore.Hosting.WebHostExtensions.<>c__DisplayClass0_0.b__0() 在 System.Action`1.Invoke(T obj)
我猜这是因为我从 Start() 中调用 Stop(),但我不知道其他任何方法。该应用程序确实关闭了,所以也许这无关紧要,但如果有人有任何建议,我真的很感激。
谢谢,嗡嗡声
有没有办法让@ angular / flex-layout 根据屏幕大小更改类?
我知道我可以这样做:
<div fxFlex="grow" fxLayout="row" fxLayout.xs="column">
Run Code Online (Sandbox Code Playgroud)
和这个:
<div fxFlex="22" fxFlex.md="10px" fxHide.lg>
Run Code Online (Sandbox Code Playgroud)
等等
我希望能够执行以下操作:
<div class="myWideClass" class.xs="myNarrowClass">
Run Code Online (Sandbox Code Playgroud)
有什么方法可以做这种事情-根据屏幕宽度更改类吗?
谢谢!