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:
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