Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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.

share|improve this question
    
are you doing this on the server, or some dev workstation? perhaps the .Net framework on the workstation is the wrong version? –  Max Vernon Nov 5 '13 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 Nov 6 '13 at 15:04
    
But yeah I will double check the .NET situations. –  sdcharle Nov 6 '13 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 Nov 6 '13 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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