gpt4 book ai didi

iis - 可以通过C#代码在IIS托管的asp.net core 2.0中设置请求超时吗?

转载 作者:行者123 更新时间:2023-12-04 11:47:20 24 4
gpt4 key购买 nike

有没有一种方法可以从C#中设置requestTimeout,而不需要在requestTimeout中设置web.config

IIS中托管的asp.net core 2.0

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore requestTimeout="00:00:04" processPath="dotnet" arguments=".\Foo.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>

Not like this

最佳答案

否,无法按照您的描述进行操作。但是根据documentation ,您可以将web.config添加到项目中,并指定此(和其他)设置值:

If a web.config file isn't present in the project, the file is created with the correct processPath and arguments to configure the ASP.NET Core Module and moved to published output.

If a web.config file is present in the project, the file is transformed with the correct processPath and arguments to configure the ASP.NET Core Module and moved to published output. The transformation doesn't modify IIS configuration settings in the file.

The web.config file may provide additional IIS configuration settings that control active IIS modules. For information on IIS modules that are capable of processing requests with ASP.NET Core apps, see the IIS modules topic.

To prevent the Web SDK from transforming the web.config file, use the IsTransformWebConfigDisabled property in the project file.

关于iis - 可以通过C#代码在IIS托管的asp.net core 2.0中设置请求超时吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50210876/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com