草庐IT

A-timeout-occurred

全部标签

c# - 错误 :An unknown error occurred while invoking the service metadata component. 无法生成服务引用

当尝试使用.netcore2.1rc1为WCF添加服务引用时,我遇到以下错误:Error:Anunknownerroroccurredwhileinvokingtheservicemetadatacomponent.Failedtogenerateservicereference我已经检查过,唯一的安全措施是传输,没有消息安全措施。日志如下:[05/24/201812:28:28],59,Importingwebservicemetadata...[05/24/201812:28:28],27,Numberofserviceendpointsfound:2[05/24/201812:2

c# - 尝试发布云服务时,我得到 : "Error: A security token validation error occured for the received JWT token..."

我正在尝试发布Azure云服务。开始发布后大约1小时,它返回此错误。我正在通过VisualStudio2013ultimate发布。我正在尝试创建一个基于Orleans的测试服务(不是示例之一)。我已经完成了step-by-stepclouddeploymenttutorial找不到任何我可能错过的东西。不过,我敢打赌这里有些东西,比如在某处设置了一些错误的连接字符串。我将再次检查它以确保一切都与教程中的一样(除非那里有错误)。另外,我使用移动服务作为API前端。设置此设置时也可能存在某些问题,因为它与我看过的示例不同。 最佳答案

c# - Hangfire 禁用并发执行 : What happens when the timeout expires?

根据Hangfire0.8.2announcementpost,Hangfire有一个DisableConcurrentExecution过滤器,当应用于一个方法时,它会阻止该方法的多个实例同时执行。DisableConcurrentExecution过滤器采用timeoutInSecondsint参数。来自链接文章中的示例:[DisableConcurrentExecution(timeoutInSeconds:10*60)]publicvoidSomeMethod(){//Operationsperformedinsideadistributedlock}我的问题是:给定一个正在等

C# 系统.Net.WebException : The underlying connection was closed: An unexpected error occurred on a send

我在一台运行WindowsServer2003的服务器上遇到此错误:System.Net.WebException:Theunderlyingconnectionwasclosed:Anunexpectederroroccurredonasend.这是我的代码...有什么想法吗?HttpWebRequestrequest=(HttpWebRequest)WebRequest.Create("https://URLHERE");//request.Headers.Add("Accept","application/xml");byte[]bytes;bytes=System.Text.E

c# - 在 .NET 中动态更改 HttpClient.Timeout

我需要在发出请求后更改HttpClient.Timeout属性。当我尝试时,出现异常:Thisinstancehasalreadystartedoneormorerequests.Propertiescanonlybemodifiedbeforesendingthefirstrequest.有什么办法可以避免这种情况吗? 最佳答案 要改变这一点,您无能为力。这只是HttpClient实现中的默认行为。TheTimeoutpropertymustbesetbeforetheGetRequestStreamorGetResponseme

c# - .Net 4.0 中的 Timeout.InfiniteTimespan?

我确实知道Timeout.InfiniteTimespan在.NET4.0中不存在。注意到,还有Timeout.Infinite确实存在于.NET4.0中我正在调用这两个方法://theChange-MethodpublicboolChange(TimeSpandueTime,TimeSpanperiod)//theConstructorofTimerpublicTimer(TimerCallbackcallback,Objectstate,TimeSpandueTime,TimeSpanperiod)在某些情况下,dueTime参数需要是无限的,这意味着事件不会被触发。我知道我可以简

c# - 底层连接已关闭 : An unexpected error occurred on a receive

我在这里是因为我在通过ftp协议(protocol)下载一些文件时遇到了问题。这很奇怪,因为它偶尔会发生,甚至是针对同一个文件。只是一个精度:我正在下载非常大的文件(从500Mo到30Go)这是我的函数返回的异常类型:(抱歉,它是法语的)System.Net.WebException:Laconnexionsous-jacenteaétéfermée:Uneerreurinattendues'estproduitelorsdelaréception。àSystem.Net.FtpWebRequest.CheckError()àSystem.Net.FtpWebRequest.SyncR

c# - SQL 服务器,C# : Timeout exception on Transaction Rollback

我遇到了一个奇怪的问题。我有一个.NET程序,我的流程逻辑需要在SQLServer2005数据库上进行长时间运行的事务(~20分钟)。没关系,因为没有人并行访问数据库。当出现问题时,应该回滚事务。在我的DbTransaction对象上的Rollback()操作很少且没有任何可见模式抛出SqlException:Message:"Timeoutexpired.Thetimeoutperiodelapsedpriortocompletionoftheoperationortheserverisnotresponding."StackTrace:atSystem.Data.SqlClient

C# : How to pause the thread and continue when some event occur?

当某些事件发生时,如何暂停线程并继续?我希望线程在单击按钮时继续。有人告诉我thread.suspend不是暂停线程的正确方法。还有其他解决方案吗? 最佳答案 你可以使用System.Threading.EventWaitHandle.EventWaitHandle会阻塞,直到收到信号为止。在您的情况下,它将通过按钮单击事件发出信号。privatevoidMyThread(){//dosomestuffmyWaitHandle.WaitOne();//thiswillblockuntilyourbuttonisclicked//co

c# - 无法连接到 VS2012 中的 localDB – "A network-related or instance-specific error occurred while establishing a connection to SQL Server..."

这很奇怪,因为我能够使用相同的连接字符串通过SSMS2008R2连接到localDB("DataSource=(LocalDB)\v11.0;IntegratedSecurity=true")只有C#代码无法连接,我尝试使用ConnectTimeout=60增加登录时间,但没有成功。我还尝试指定数据库InitialCatalog=其中是我通过ssms在localdb上创建的。关于为什么没有连接的任何指示? 最佳答案 有没有可能是因为您忘记对反斜杠进行两次转义?你试过这个吗:"DataSource=(LocalDB)\\v11.0;I