简体   繁体   English

我们如何将ReSharper Test Runner 9.2定位到.Net 4.6,因此默认情况下它支持TLS 1.2?

[英]How do we get the ReSharper Test Runner 9.2 to target .Net 4.6, so it supports TLS 1.2 by default?

We have some Manual Integration tests that hit a Salesforce WebService Endpoint that requires TLS 1.1. 我们有一些手动集成测试,可以到达需要TLS 1.1的Salesforce Web服务端点。 We have upgraded our projects to use .Net 4.6 which resolves to TLS 1.2 by default. 我们已将项目升级为使用.Net 4.6,默认情况下可解析为TLS 1.2。

However, when we use the ReSharper 9.2 TestRunner to invoke the manual integration tests (which are using NUnit 2.6.4), Salesforce throws and error saying we're using TLS 1.0 and that we need to be using TLS 1.1 or higher. 但是,当我们使用ReSharper 9.2 TestRunner调用手动集成测试(正在使用NUnit 2.6.4)时,Salesforce会抛出错误并指出我们正在使用TLS 1.0,并且需要使用TLS 1.1或更高版本。

Now, we can use ServicePointManager to force TLS 1.2, but we're trying to also test that our .Net 4.6 projects are resolving to TLS 1.2 as well. 现在,我们可以使用ServicePointManager强制使用TLS 1.2,但我们还尝试测试.Net 4.6项目是否也可以解析到TLS 1.2。 We have also tried setting the targetFramework to .Net 4.6 in JetBrains.ReSharper.TaskRunner.CLR4.x64.exe.config , but it still resolves to TLS 1.0 (so we're guessing it's targeting .Net 4.5 or under). 我们还尝试在JetBrains.ReSharper.TaskRunner.CLR4.x64.exe.config中将targetFramework设置为.Net 4.6,但是它仍然解析为TLS 1.0(因此我们猜测它的目标是.Net 4.5或更低版本)。

When we run the same code under the context of a website or a windows form app, we have no issues and don't need the ServicePointManager to force TLS 1.2. 当我们在网站或Windows窗体应用程序的上下文中运行相同的代码时,我们没有任何问题,也不需要ServicePointManager强制使用TLS 1.2。 What are we missing here? 我们在这里想念什么? Is ReSharper 9.2 not able to target .Net 4.6? ReSharper 9.2无法定位到.Net 4.6吗?

How do we get the ReSharper Test Runner to target .Net 4.6, so it supports TLS 1.2 by default? 如何使ReSharper Test Runner定位到.Net 4.6,因此默认情况下它支持TLS 1.2?

Salesforce Error: System.Web.Services.Protocols.SoapException : UNSUPPORTED_CLIENT: TLS 1.0 has been disabled in this organization. Salesforce错误: System.Web.Services.Protocols.SoapException:UNSUPPORTED_CLIENT:在此组织中已禁用TLS 1.0。 Please use TLS 1.1 or higher when connecting to Salesforce using https. 使用https连接到Salesforce时,请使用TLS 1.1或更高版本。

Forcing to TLS 1.2 does work: ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; 强制使用TLS 1.2确实有效: ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

What is the target framework of your project? 您的项目的目标框架是什么? ReSharper will run with a runner that is the same as the target version. ReSharper将以与目标版本相同的运行程序运行。 So if you have a 4.0 project, ReSharper will run with the 4.0 runner (which runs on 4.6 in compatibility/quirks mode). 因此,如果您有一个4.0项目,则ReSharper将与4.0运行程序一起运行(在兼容/怪癖模式下以4.6运行)。 You should change that target framework to be 4.5 or above to run in the 4.5 runner (which runs without the 4.0 compatibility fixes). 您应该将该目标框架更改为4.5或更高版本,以在4.5运行程序中运行(运行时无需安装4.0兼容性修补程序)。

Alternatively, use the drop down in the Unit Test Session window to specify what framework you want. 或者,使用“单元测试会话”窗口中的下拉列表指定所需的框架。 By default, it's set to Auto, to match the project's target framework, but you can override it if you need to. 默认情况下,它设置为“自动”以匹配项目的目标框架,但是您可以根据需要覆盖它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM