.Net Framework Error - System.ServiceModel

  • Hi,

    I have some some CLR methods which invokes WCF methods. I've deployed the required assemblies along with my SQL Project. The assembly got successfully deployed in SQL Server and the user defined functions got created. I'm able to invoke CLR methods which are not invoking WCF, but when WCF invoking UFS's are called. The below mentioned error is raised.

    A .NET Framework error occurred during execution of user-defined routine or aggregate "SendRequest": System.IO.FileLoadException: Could not load file or assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. Assembly in host store has a different signature than assembly in GAC. (Exception from HRESULT: 0x80131050) See Microsoft Knowledge Base article 949080 for more information.

    System.IO.FileLoadException: at SQL.Utility.ServiceManager.SendRequest(String serviceAddress, Int64 deviceSerialNo, Int64 serialNo, Int64 requestId).

    Initially the configuration of the DB Server was

    1. Windows 2008 Server - 32 bit

    2. SQL Server 2008 Enterprise Edition - 32 bit

    I was able to deploy and access all functions including UDF's invoking WCF's without any issue.

    Now I've formatted the server and configured the same with 64 bit. All the required 64 bit assemblies have been deployed to the Server. The SQL Project which I've created was not able to deploy with X64 build. So I've used "Any CPU" option and it sql project was deployed successfully. I'm able to access simple UDF's generated by my SQL Project, but the above mentioned error is raised on accessing UDF's invoking WCF methods.

    The assemblies deployed in SQL Server are

    Microsoft.Transactions.Bridge

    SMDiagnostics

    System.Configuration.Install

    System.DirectoryServices

    System.DirectoryServices.Protocols

    System.Drawing

    System.Drawing.Design

    System.EnterpriseServices

    System.Messaging

    System.Runtime.Remoting

    System.Runtime.Serialization.Formatters.Soap

    System.ServiceProcess

    System.Web

    System.Web.RegularExpressions

    System.Windows.Forms

    System.IdentityModel

    System.IdentityModel.Selectors

    System.Runtime.Serialization

    System.ServiceModel

    I've checked the GAC and the assembly version, publickeytoken is the same for assembly in GAC and SQL.

    Any pointers would be helpful.

    Thanks in advance,

    Shyam SS

  • Some suggestions

    1.) Is .NET 3.5 installed on your server?

    2.) Is your assembly compiled as "Any CPU" or "x64" assembly?

    3.) Did you try to add System.ServiceModel.dll manually as assembly?

    Here another thread on MSDN:

    http://social.msdn.microsoft.com/forums/en-US/sqlnetfx/thread/3dfee9d1-0cfd-48da-a90f-100a7d67ee1c/

    Greets

    Flo

  • I am having the same issue - deployment to a 32 bit OS is fine, but the 64 bit server presents the same error.

    .NET 3.5 is installed on the server, and I've manually registered the 64-bit version of System.ServiceModel.dll with the database.

    My custom DLL's project references have also been updated to use the 64-bit ServiceModel.dll, but it is compiled as targeting "any" CPU. Could this be causing the issue?

    (I do not currently have a 64-bit dev box to target 64-bit specifically..)

  • Okay, fixed the issue.

    See http://www.humanworkflow.net/post/2009/02/27/Getting-WCF-To-Work-With-SQL-CLR-Objects-64bit-Environment.aspx for details on 64-bit environments.

    If (like me) you still encounter problems with System.IdentityModel after this, try replacing the references to C:\Program Files\Reference Assemblies\Microsoft\Framework with the 32-bit path C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply