小编rin*_*esh的帖子

获取 无法访问已处置的对象。对象名称:.Net 6 应用程序中的“SocketsHttpHandler”异常

在我的 Azure Function 应用程序之一(.Net 6 隔离进程)中,我正在使用客户端证书发出一些 http 请求。我正在 Program.cs 中注册我的服务,如下所示,

var handler = new HttpClientHandler();
handler.ClientCertificates.Add(clientCertificate);

services.AddHttpClient().Configure<HttpClientFactoryOptions>(
               "myClient", options =>
                   options.HttpMessageHandlerBuilderActions.Add(builder =>
                       builder.PrimaryHandler = handler));

services.AddTransient<IMyCustomClient, MyCustomClient>(provider =>
           new MyCustomClient(provider.GetService<IHttpClientFactory>(),
               cutomParameter1, cutomParameter2));

services.AddSingleton<IMyCustomService, MyCustomService>();
Run Code Online (Sandbox Code Playgroud)

并在 MyCustomService 构造函数中注入 MyCustomClient

private readonly IMyCustomClient _myCustomClient;

public PlatformEventManagementService(IMyCustomClient myCustomClient)
{
    _myCustomClient = myCustomClient;
}
Run Code Online (Sandbox Code Playgroud)

var result = await _myCustomClient.GetResponse();

它工作正常一段时间,并在发送许多请求后出现以下异常。

Cannot access a disposed object. Object name: 'SocketsHttpHandler'.

asp.net dotnet-httpclient azure-functions .net-6.0

8
推荐指数
1
解决办法
6696
查看次数

Windows Server 2012 R2上的TFS 2010应用程序层配置失败

我在Windows Server 2012R2上为Visual Studio 2010安装了TFS.ISS已配置IIS 6兼容性,静态内容压缩和Windows身份验证.但是应用程序层配置失败,并出现以下错误

Error   [ Application Tier ] TF255120: Compatibility mode for Internet Information Services (IIS) 6.0 is not enabled. Team Foundation Server requires this on this operating system.
Error   [ Application Tier ] TF255456: You must configure Internet Information Services (IIS) to use the Static Content component. Team Foundation Server requires the Static Content component in IIS.
Error   [ Application Tier ] TF255397: Windows Authentication has not been configured as a role service in Internet Information …
Run Code Online (Sandbox Code Playgroud)

tfs visual-studio-2010 tfs2010 iis-8 azure-devops

3
推荐指数
1
解决办法
4095
查看次数

使用 YAML 配置时,清理 Azure DevOps Pipeline 设置中的所有构建目录不起作用

我使用 Azure DevOps 有一段时间了,并且在制作 Build Pipeline 时我总是使用经典编辑器 GUI。现在我正在尝试使用 YAML 创建新管道。一切顺利,构建成功。但是,与使用经典编辑器的管道相比,我注意到结帐任务中的不同行为。在两个管道中,“获取源”选项卡中使用的设置是相同的(请参见下面的屏幕截图)

在此处输入图片说明

在经典编辑器管道的情况下,签出任务删除并重新创建$(Agent.BuildDirectory).这将导致为每个构建初始化一个新的本地 Git 存储库。但是,对于 YAML 管道,结帐任务仅执行 agit clean -ffdx并仅删除源目录。如何解决 YAML 管道的这个问题?

YAML 管道日志:

在此处输入图片说明

经典编辑器管道日志:

在此处输入图片说明

git devops azure-devops azure-pipelines azure-yaml-pipelines

3
推荐指数
1
解决办法
2819
查看次数

SQL Server中用户定义的函数有什么需求?

SQL Server中用户定义函数的确切需求是什么?

我们可以使用功能完成的所有事情都可以由存储过程完成,那么为什么要引入用户定义的功能呢?

我知道存储过程和函数之间的区别,但是没有一个可以澄清我的问题,而且我找不到函数可以执行的任何操作而存储过程无法做到的任何事情。

功能仅仅是为了更好的可维护性和理解性,还是我缺少某些东西?

sql sql-server user-defined-functions

1
推荐指数
2
解决办法
71
查看次数