简体   繁体   中英

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. We have upgraded our projects to use .Net 4.6 which resolves to TLS 1.2 by default.

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.

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. 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).

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. What are we missing here? Is ReSharper 9.2 not able to target .Net 4.6?

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

Salesforce Error: System.Web.Services.Protocols.SoapException : UNSUPPORTED_CLIENT: TLS 1.0 has been disabled in this organization. Please use TLS 1.1 or higher when connecting to Salesforce using https.

Forcing to TLS 1.2 does work: 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. 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). 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).

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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