All versions of .NET starting with version 4.5 contain updates as you can see here .
This means that after installing .NET 4.6, you will always get the version of SqlConnection.NET 4.6 no matter how you create it.
When you create an application in Visual Studio, you create against a specific version of the .NET framework, usually located in the folder under: C: \ Program Files (x86) \ Reference Assemblies \ Microsoft \ Framework.NETFramework
This means that when creating msbuild, you can verify that you are not using what is not available in the version of the frame that you are targeting.
However, when launching your 64-bit application, it will use the assemblies usually located in C: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319
This is the same folder for all versions from .NET 4.0 to .NET 4.6, which means the update means.
Therefore, when you run your application in your development environment on which .NET 4.6 is installed, you will always get the version of .NET 4.6 (at least if you do not do something special to download other versions of assemblies).
Castle Windsor will try to set properties using a public setter , and it will use reflection to find properties, which means it will find .NET. 4.6 on a .NET 4.6 machine, even if you create against 4.5.1.
The reason it fails when it tries to set the AccessToken is most likely because your connection string is incompatible with setting the AccessToken.
If you check the source code of the AccessToken installer, you will see that it will throw an exception if you try to set it for an incompatible connection string, even if you are only trying to set the AccessToken to an empty string.
Since you do not need to inject any dependencies into the SqlConnection object, you can simply create it using the new operator, and then you will avoid the problem caused by Windsors trying to inject connection properties. Using this registry should work:
container.Register(Component.For<IDbConnection>().ImplementedBy<SqlConnection>() .LifestyleTransient() .UsingFactoryMethod(() => new SqlConnection (ConfigurationManager.ConnectionStrings["DbConnectionString"].ConnectionString)));