Quantcast
Channel: SQL Server Replication forum
Viewing all articles
Browse latest Browse all 4054

SQL 2014 Replication Assemblies version mismatch - Microsoft.SQLServer.RMO and .Replication are .Net 4, SMO, Connection are .Net 2

$
0
0

I have C# project that I use to create a pull merge replication subscription. This project generates a DLL that has COM interop support. Our main application is not written in a .Net language.  Having the COM support on my subscription assembly allows me to call into the .Net world from our main program.

I have been using this methodology successfully since SQL Server 2005 through 2012.

However, in SQL 2014 some of the assemblies are now version .Net 4 but others are still .Net 2.

Specifically, my project framework target is .Net 4 and it references:

  • Microsoft.SqlServer.ConnectionInfo - .Net 2.x
  • Microsoft.SqlServer.Management.Sdk.Sfc - .Net 2.x
  • Microsoft.SqlServer.Replication - .Net 4
  • Microsoft.SqlServer.Rmo - .Net 4
  • Microsoft.SqlServer.Smo - .Net 2

When I call into my assembly I'm receiving this error:

Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

I found the following link which discuss this error:

http://social.msdn.microsoft.com/Forums/vstudio/en-US/1f60a379-e2e3-46b9-b343-0235486fc746/mixed-mode-assembly-is-built-against-version-v2050727-of-the-runtime-and-cannot-be-loaded-in-the?forum=clr

The link in that forum to stack overflow talks about adding

<startupuseLegacyV2RuntimeActivationPolicy="true"><supportedRuntimeversion="v4.0"/></startup>

to my application .config file, but my assembly does not have a app.config file.

If anyone can point me in the right direction I would appreciate it.

This link mentions an AdventureWorks example for 2014 replication but I cannot find the source. That might be enough to get me going in the right direction.

http://technet.microsoft.com/en-us/library/ms146892.aspx

Thanks, Rick


Viewing all articles
Browse latest Browse all 4054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>