none
Could not load file or assembly 'Microsoft.SqlServer.Replication.dll' or one of its dependencies. The specified module could not be found. RRS feed

  • Question

  • Hi,

    I have an application built in VB.NET 2010 that is connecting to MSSQL Server 2008 R2 Express. I'm trying to do the replication between the Express sever and Standard server. It works fine on the developer machine (Windows 7) and on the Terminal Server 2003 R2 machine. 

    However, there is one machine, running Windows 7 that gets this error when I run the sync function.

    System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.Replication.dll' or one of its dependencies. The specified module could not be found.

    File name: 'Microsoft.SqlServer.Replication.dll'

    The file 'Microsoft.SqlServer.Replication.dll' is located in the same folder where the executable file is. I've searched everywhere and cannot find a reason why this is happening...

    I tried installing Microsoft SQL Server 2008 Replication Management Objects x86 and x64, but that didn't help.

    Any ideas??

    Dragan

    Friday, March 9, 2012 8:15 AM

Answers

  • Hi CP6UH,

    It may be caused by the corrupted Microsoft.SqlServer.Replication.dll file. You could try to repair the SQL Server using SQL Server setup file.

    Reference: http://msdn.microsoft.com/en-us/library/cc646006.aspx.


    Thanks,
    Maggie


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.

    Monday, March 12, 2012 10:02 AM
    Moderator

All replies

  • Hi,

    Did you install replication files with SQL Express. You need to select it on the features window during the install.

    I hope it helps.

    Janos


    There are 10 type of people. Those who understand binary and those who do not.
    My Blog

    Friday, March 9, 2012 8:36 AM
  • Did you got to Project, Properties, Publish and then clicked on Application Files and selected the replication dlls?

    looking for a book on SQL Server 2008 Administration? http://www.amazon.com/Microsoft-Server-2008-Management-Administration/dp/067233044X looking for a book on SQL Server 2008 Full-Text Search? http://www.amazon.com/Pro-Full-Text-Search-Server-2008/dp/1430215941

    Friday, March 9, 2012 5:08 PM
    Moderator
  • You need to set the Platform target to x86.  This can be done from project properties -> Build tab -> Platform target -> x86.  Rebuild your solution and re-deploy.

    Brandon Williams (blog | linkedin)

    Friday, March 9, 2012 6:03 PM
    Moderator
  • It is set to Prerequisite (Auto), but I'm not publishing my application. I'm deploying it through Installation wizard, and the dlls are included in the Deployment project.
    Friday, March 9, 2012 11:17 PM
  • It's set to x86 already...
    Friday, March 9, 2012 11:17 PM
  • I'm pretty sure that was selected when SQL express was installed. Wouldn't application use the dlls that were provided by the installation package though?
    Friday, March 9, 2012 11:18 PM
  • Hi CP6UH,

    It may be caused by the corrupted Microsoft.SqlServer.Replication.dll file. You could try to repair the SQL Server using SQL Server setup file.

    Reference: http://msdn.microsoft.com/en-us/library/cc646006.aspx.


    Thanks,
    Maggie


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.

    Monday, March 12, 2012 10:02 AM
    Moderator
  • How can the same DLL get corrupted immediately after installation in one machine while in other machine it is working perfectly?

    For me, this error is coming in some machine of my website inspite of the DLL being present in the bin folder for that website.

    Thanks and Regards,

    Anirban Saha

    Thursday, April 2, 2015 9:50 AM
  • Hello cP6uH,

    A long shot but did you ever find a solution to this? I have almost the same issue: I can run the replication code (as long as I compile as x86 - I haven't seen a 64 bit version of the Replication object) on my Dev machine but if I run from a Windows Server 2012 I get your error (although I'm using VS 2013 .Net 4.5) on both dev machine and server. I got a dependency tree for the Microsoft.SqlServer.Replication.dll and successfully tested each dependent reference successfully but as soon as I attempt to call something on the Micorsoft.SqlsServer.Replication object I get the FileNotFoundException.

    Very frustrating.

    Wednesday, June 24, 2015 3:19 PM