我有以下设置:在应用程序负载均衡器(AWS)后面的几个Linux容器(构建在aspnetcore 2.0.5上)中运行的web api
使用HttpClient向此api发出请求的客户端.客户端并行运行多个任务的调用.如果并行任务的数量增加,则api开始抛出异常并显示消息"请求超时".
调用堆栈是:
在Microsoft.AspNetCore的Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO.Pipelines.PipeCompletion.ThrowFailed()在Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO.Pipelines.Pipe.GetResult(ReadResult&result)上Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO中的.Server.Kestrel.Internal.System.IO.Pipelines.Pipe.Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO.Pipelines.IReadableBufferAwaiter.GetResult() .Pipelines.ReadableBufferAwaitable.GetResult()at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.MessageBody.d__24.MoveNext()---从抛出异常的上一个位置的堆栈跟踪结束---在System. Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame`1.d__2.MoveNext()中的System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务)中的Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
什么可能导致此错误,谁设置超时,我该如何进一步调查?
编辑:如果我尝试使用fiddler来捕获失败的请求,则不再抛出错误(也许fiddler正在以较低程度的并行性打开连接).
我有一个net core consoleapp项目,如下(VS 2017风格):
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.1</TargetFramework>
<Version>2.0.0</Version>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<FileVersion>4.0.0.0</FileVersion>
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
</PropertyGroup>
</Project>
Run Code Online (Sandbox Code Playgroud)
我可以毫无问题地构建项目,我可以使用dotnet publish -r win10-x64发布它,它将与dll文件一起生成exe文件.我的问题是exe文件有一些奇怪的FileVersion和ProductVersion字段(在我的例子中FileVersion = 1.0.1.4500和ProductVersion 1.0.1.cee57 ...(一些guid)).其余的文件详细信息(名称,版权)与dotnet而不是我自己的项目有关.
发布时有什么方法可以控制exe细节吗?
我在 SSMS 查询窗口中运行了一个类似于下面的脚本。脚本成功运行后,受影响的表上保留了一些锁。当我尝试关闭窗口时,会显示一个消息框,询问我是要提交还是取消事务。
在我选择其中一个选项后,锁定被释放。什么会导致这种行为?
begin tran
delete from tableA
delete from tableB
insert into tableB
insert into tableA
commit tran
Run Code Online (Sandbox Code Playgroud)
我已连接到远程 Sql Server 2014 并运行本地 SSMS 2014
谢谢!
我正在尝试使用下面的代码更新 app.config 文件中的值(该值在“属性”>“设置”中定义为“应用程序范围”)
System.Configuration.Configuration configApp = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
MessageBox.Show(configApp.AppSettings.Settings.Count.ToString()); //this shows 0
configApp.AppSettings.Settings["PontajAdminPwd"].Value = "dsfs";
configApp.Save(ConfigurationSaveMode.Full);
Run Code Online (Sandbox Code Playgroud)
但它说 configApp.AppSettings.Settings 是空的......
这是我的 app.config 文件的一部分
System.Configuration.Configuration configApp = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
MessageBox.Show(configApp.AppSettings.Settings.Count.ToString()); //this shows 0
configApp.AppSettings.Settings["PontajAdminPwd"].Value = "dsfs";
configApp.Save(ConfigurationSaveMode.Full);
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
谢谢
编辑1:我很着急,所以我采用了这里提出的解决方案(手动更改app.config文件后直接文件访问 - 使用appSettings而不是applicationSettings):http:
//www.longhorncorner.com/uploadfile/rahul4_saxena /update-app-config-key-value-at-run-time-in-wpf/
c# ×3
.net ×1
.net-core ×1
app-config ×1
asp.net-core ×1
sql ×1
sql-server ×1
ssms ×1
task ×1
transactions ×1
wpf ×1