I encountered a bizarre prob today while creating a transactional publication on a SQL 2012 server running on Windows Server 2008R2.

I had just had some success creating and initializing some Merge publications (including generating snapshots) on this same server.

With my transactional publication though, around the time the snapshot agent goes to lock tables, it gives me this:

A .NET Framework error occurred during execution of user-defined routine or aggregate "sp_scriptdropinsreconciliationproc_sqlclr":

System.TypeInitializationException: The type initializer for >'System.Data.SqlClient.SqlConnection' threw an exception. ---

Here are some things I tried:

  • Google: surprisingly few results. A reference to KB2840628, which is not on the system.
  • Search here: nothing found
  • Manually create subscription thru the GUI (had been using a script) - fail
  • Same as above but publish from a different database - fail

In these tests I am using ridiculously powerful accounts to try to rule out permissions issues.

It's very strange. Any helpful hints would be appreciated.

  • are you doing this on the server, or some dev workstation? perhaps the .Net framework on the workstation is the wrong version?
    – Hannah Vernon
    Commented Nov 5, 2013 at 22:55
  • Here's the beauty of it, it works on dev, but not acceptance. Only major difference is Acceptance is Windows Core, Dev is GUI-fied Windows.
    – sdcharle
    Commented Nov 6, 2013 at 15:04
  • But yeah I will double check the .NET situations.
    – sdcharle
    Commented Nov 6, 2013 at 15:05
  • Yup, had .NET 4.5 on dev but not Acc. Silly me. That got me past this hurdle. Looks like the aforementioned KB applied to .NET 4.0, too. Anyhow thanks.
    – sdcharle
    Commented Nov 6, 2013 at 16:24

1 Answer 1


The error:

System.TypeInitializationException: The type initializer for 'System.Data.SqlClient.SqlConnection'

is typically (in my experience!) indicative of a mismatch between the version of .Net on the machine initiating the connection, and the target machine.

Ensure both machines have the same version of the .Net distributable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.