问题描述
我正在使用Microsoft.AspNetCore.SpaServices.Webpack
中的Webpack中间件为客户端应用程序构建带有VanillaJS
的aspnetcore应用程序,并为其使用Webpack模块捆绑器。这是我的Startup's Configure(...)
:
if (env.IsDevelopment())
{
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions
{
ProjectPath = Path.Combine(Directory.GetCurrentDirectory(),"ClientApp"),HotModuleReplacement = true
});
app.UseDeveloperExceptionPage();
}
但是每次我用CTRL-C
取消正在运行的应用程序时,都会引发如下异常:
Unhandled exception. System.OperationCanceledException: The operation was canceled.
at System.Threading.CancellationToken.ThrowOperationCanceledException()
at System.Threading.CancellationToken.ThrowIfCancellationRequested()
at Microsoft.Extensions.Hosting.Internal.Host.StopAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.WaitForShutdownAsync(IHost host,CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host,CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
at Revolt.Program.Main(String[] args) in C:\Workspace\revolt\Revolt\Program.cs:line 16
在浏览器控制台中,它显示:
GET https://localhost:5001/dist/__webpack_hmr net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK)
2:5001/dist/__webpack_hmr:1 GET https://localhost:5001/dist/__webpack_hmr net::ERR_CONNECTION_REFUSED
这是怎么了?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)