Please refer to this question. You need to do one of the following:
- Add the
Type System Version=SQL Server 2012 keyword to the connection string in app.config :
<configuration> <connectionStrings> <add name="YourConnectionStringName" connectionString="(connection string values);Type System Version=SQL Server 2012" /> </connectionStrings> </configuration>
- Add
bindingRedirect for Microsoft.SqlServer.Types in app.config :
<configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> </configuration>
Any option ensures that SqlConnection downloads version 11.0.0.0 of the Microsoft.SqlServer.Types assembly instead of version 10.0.0.0.
source share