As was mentioned in the Tip 1058, the most simple and easy way to deal with TLS 1.2 in your code is to recompile it with .net 4.6.2+.
As David “Xrm.Tools” Yack discovered, it may not work for some of the existing projects. The issue is that, when the framework version changes in Visual Studio there is a secondary setting in web.config that can override that!
<compilation debug="true" targetFramework="4.7" /> <httpRuntime targetFramework="4.5.2" />
The httpRuntime target framework stays the same when you change the project settings – it has to be manually updated. If you don’t, then the project will really be running as 4.5.2 while deployed as 4.7. If your project tries to connect to Dynamics 365 version 9 (where TLS 1.2 is enforced), you will receive seemingly unrelated errors, and/or unexpected results from some function calls.
It’s the small things that bite you hard! – David Yack (c) 2018