Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在ASP.net core 2.1中使用WCF或Reporting Services与AlanJuden MvcReportViewer一起使用时出现超时问题_C#_Asp.net Mvc_Asp.net Core_Wcf_Reporting Services - Fatal编程技术网

C# 在ASP.net core 2.1中使用WCF或Reporting Services与AlanJuden MvcReportViewer一起使用时出现超时问题

C# 在ASP.net core 2.1中使用WCF或Reporting Services与AlanJuden MvcReportViewer一起使用时出现超时问题,c#,asp.net-mvc,asp.net-core,wcf,reporting-services,C#,Asp.net Mvc,Asp.net Core,Wcf,Reporting Services,MVC解决方案中有两个项目。一个web应用程序和一个报告应用程序。报告可从web应用程序按需获取。Web应用程序运行良好,报告控制器中包含超时。 (_context.Database.SetCommandTimeout(300);) 如果我运行任何报告或WCF作业,我会得到以下错误,但如果我立即再次运行它们,它们会正常运行。如果我等到第二天,我会得到同样的结果 这似乎是一个与报告服务相关的常见问题,但我已经没有想法了 报告错误: AggregateException:发生了一个或多个错误。(请求

MVC解决方案中有两个项目。一个web应用程序和一个报告应用程序。报告可从web应用程序按需获取。Web应用程序运行良好,报告控制器中包含超时。 (_context.Database.SetCommandTimeout(300);)

如果我运行任何报告或WCF作业,我会得到以下错误,但如果我立即再次运行它们,它们会正常运行。如果我等到第二天,我会得到同样的结果

这似乎是一个与报告服务相关的常见问题,但我已经没有想法了

报告错误: AggregateException:发生了一个或多个错误。(请求通道在00:01:00之后尝试发送时超时。 增加传递给请求调用的超时值或增加绑定上的SendTimeout值。分配给此操作的时间可能是更长超时的一部分。)

System.Threading.Tasks.Task.GetResultCore(bool waitCompletionNotification)

TimeoutException:请求通道在00:01:00之后尝试发送时超时。增加传递给请求调用的超时值或增加绑定上的SendTimeout值。 分配给此操作的时间可能是较长超时的一部分

AsyncResult.cs第354行中的System.Runtime.AsyncResult.End(IAsyncResult结果)

WCF错误: TimeoutException:对“”的HTTP请求http://keeper/ReportServer/ReportExecution2005.asmx'已超过分配的00:01:00超时。 分配给此操作的时间可能是较长超时的一部分

System.ServiceModel.Channels.HttpChannelFactory+HttpClientRequestChannel+HttpClientChannelAsyncRequest.SendRequestAsync(消息, HttpChannelFactory.cs第1048行中的TimeoutHelper(TimeoutHelper)

TimeoutException:请求通道在00:01:00之后尝试发送时超时。增加传递给请求调用的超时值或增加绑定上的SendTimeout值。 分配给此操作的时间可能是较长超时的一部分

AsyncResult.cs第354行中的System.Runtime.AsyncResult.End(IAsyncResult结果)

已添加web.config文件:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
      </handlers>
      <aspNetCore requestTimeout="00:30:00" processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
    </system.webServer>
  </location>
  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding openTimeout="00:10:00"
                 closeTimeout="00:10:00"
                 sendTimeout="00:10:00"
                 receiveTimeout="00:10:00"
                 maxBufferPoolSize="2147483647" 
                 maxReceivedMessageSize="2147483647">
        </binding>
      </wsHttpBinding>
      <basicHttpBinding>
        <binding openTimeout="00:10:00"
                 closeTimeout="00:10:00"
                 receiveTimeout="00:10:00"
                 sendTimeout="00:10:00"
                 maxBufferPoolSize="2147483647"
                 maxReceivedMessageSize="2147483647"
                 maxBufferSize="2147483647">
        </binding>
      </basicHttpBinding>
    </bindings>
  </system.serviceModel>
</configuration>

requestTimeout=“00:30:00”停止了WCF作业,因此现在要么不启动,要么运行到完成。web.config中的其他内容似乎都不会影响结果

我们还查看了C:/Program Files/Microsoft SQL Server Reporting Services/SSRS/ReportServer/rsreportserver.config文件,但看不到任何可能与00:01:00问题有关的超时

2020年12月4日已将web.config文件更改为:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  
  <location path="." inheritInChildApplications="false">
    
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
      </handlers>
      <aspNetCore startupTimeLimit="600" shutdownTimeLimit="600" requestTimeout="00:30:00" processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
    </system.webServer>
  
    <system.serviceModel>
      
      <bindings>
        <basicHttpBinding>
          <binding name="ServiceReference1"
                   openTimeout="00:10:00"
                   closeTimeout="00:10:00"
                   receiveTimeout="00:10:00"
                   sendTimeout="00:10:00"
                   maxBufferPoolSize="2147483647"
                   maxReceivedMessageSize="2147483647"
                   maxBufferSize="2147483647">
          </binding>
        </basicHttpBinding>
      </bindings>

      <services>
        <service name="ServiceReference1">
          <endpoint address="http://Keeper/ReportServer/ReportExecution2005.asmx"
                    binding="basicHttpBinding"
                    bindingConfiguration="ServiceReference1"
                    contract=""/>
        </service>
      </services>
      
    </system.serviceModel>
    
  </location> 
  
</configuration>
enter code here

Latest web.config 6/12/2020

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
      </handlers>
      <aspNetCore requestTimeout="00:30:00" processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
    </system.webServer>
  </location> 
</configuration>

在这里输入代码
最新web.config 6/12/2020

在您的配置文件中,我看不到您的端点,并且绑定的超时属性未应用于该端点。从错误报告来看,似乎是超时属性的问题

对于不同的超时属性,最重要的是sendTimeout,它表示客户端等待WCF服务响应的时间

OpenTimeout是您在打开与WCF服务的连接时愿意等待的时间

类似地,closeTimeout是在关闭连接(放置客户端代理)之前等待抛出异常的时间

ReceiveTimeout是客户端接收和处理服务器响应的时间

您可以尝试增加timeout属性并将其应用于端点


有关如何在wcf中配置端点,您可以查看以下链接:

如注释中所述,rsreportserver.config文件中的RecycleTime会触发SQL Server Reporting Services服务的重新启动。 每次发生这种情况时,都需要初始化Reporting Services,这是由该事件之后运行的第一次报告触发的。 如前所述,此初始化大约需要2分钟,(对我而言)会导致1分钟超时错误

仍然不知道这个超时是从哪里来的,但这是多亏了Pavel和

基本上这意味着:将RecycleTime设置为1500(25小时),创建每天早晨运行的计划任务,该任务将触发Powershell脚本以重新启动Reporting Services,然后访问Reporting Services文件夹对其进行初始化。 注意:对于本地主机和生产,我只有1个Reporting Services。如果你有两份工作,你可能需要两份工作

Pavel对Powershell脚本的命令:

  • 停止服务“SQL Server Reporting Services(MSSQLSERVER)”
  • 启动服务“SQL Server Reporting Services(MSSQLSERVER)”
  • $wc=新对象system.net.webClient
  • $cred=[System.Net.CredentialCache]::DefaultNetworkCredentials
  • $wc.Credentials=$cred
  • $src=$wc.DownloadString(“http://localhost/Reports/Pages/Folder.aspx))
  • 我使用了以下内容,并将其包含在我的解决方案中,以将其保持在一起:

  • echo“重新启动SQL Server Reporting Services”
  • 重新启动服务“SQL Server Reporting Services”
  • 开始睡眠-s30
  • echo“SQL Server Reporting Services可用”
  • $wc=新对象system.net.webClient
  • $cred=[System.Net.CredentialCache]::DefaultNetworkCredentials
  • $wc.Credentials=$cred
  • echo“报告服务初始化启动”
  • $src=$wc.DownloadString(“http://keeper/ReportServer/Reports))
  • echo“Reporting Services初始化完成”
  • 开始睡眠-s30
  • 回显“启动完成”
  • 这大约需要3英里