none
Could not load file or assembly 'Microsoft.AnalysisServices.AdomdClient' Error RRS feed

  • Question

  • Hi,

     

    One of our stored procedure is making use of an assembly to execute a mdx statement against OLAP database. On executing the sp, we get below error message.

     

    On analysis we found that this type of issue is common for SQL Server 2008 R2 and to overcome the same, we have to install the Cumulative Update package 6 for SQL Server 2008 R2.We installed the same, even then we are facing this error.

    Please find the error msg for the same.

     

    "Msg 6522, Level 16, State 1, Procedure ExecuteMDX, Line 0
    A .NET Framework error occurred during execution of user-defined routine or aggregate "ExecuteMDX":
    System.IO.FileLoadException: Could not load file or assembly 'Microsoft.AnalysisServices.AdomdClient, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' 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 StoredProcedures.ExecuteMdxQuery(String server, String database, Int32 SecurityTypeID, String effectiveUserName, String query)

     

    The same sp is working fine in Sql server 2005. Please help us on this error. Thank

     

    Regards,

    Bharat

    Friday, November 25, 2011 6:53 AM

Answers

  • Thanks a lot Philips. As per user suggestion we managed to solve the assembly creation issue in SQL Server 2008 R2 that’s been in existence for long time. Replaced the SQL Server assembly version in the GAC with standard set of procedures.

     

     

    Below are the steps followed to resolve the issue:

    Installing an assembly into GAC

    ·     You can drag and drop dlls into GAC by changing the Local Security Policy on the Win2008 server.

    1. Start>> Run >> write secpol.msc

    2. Expand "Local Policies" >> Click "Security Options"

    3. Right click on "User Account Control: run all administrators in Admin Approval Mode" , select "Properties"

    4. Disable it. Click OK.

    5. Restart windows

    Check gacutil.exe 

    1. First check that if server is of 32 bit or 64 bit?

    2. If it is 64 bit then open folder “C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64“

    3. But if it is 32 bit then open folder “C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin“

    4. Copy 2 files i.e. gacutil.exe & gacutil.exe.config

    5. Paste these files to above location of the server.

    6. Your gacutil.exe is now ready to run and u can install assembly in to GAC using this small utility.

     

    Installing Assembly using gacutil.exe 

    1. Start>>Run>>cmd (Run as administrator)

    2. If it is 64 bit then open folder “C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64“

    3. Type cd C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64

    4. if it is 32 bit then open folder “C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin“

    5. Type cd C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin

    6. Press enter

    7. Type gacutil.exe /i

    8. Copy paste below two attached file in D:\

    9. Type gacutil –if "D:\Microsoft.AnalysisServices.AdomdClient.dll" in cmd, press enter.

    10. Also type gacutil –if "D:\Microsoft.AnalysisServices.dll" in cmd, press enter.

    The above procedures will resolve this issue.

     

    Regards,

    Bharat

     


    Wednesday, November 30, 2011 11:24 AM
  • Hi Bharat,

    Please navigate to C:\Windows\Assembly and locate Microsoft.AnalysisServices.AdomdClient.dll to check the version number. For 2008 R2, it is 10.0.0.0 required. If no 10.0.0.0, install it by download Microsoft® SQL Server® 2008 R2 ADOMD.NET and running Adomd.NET from http://www.microsoft.com/download/en/details.aspx?id=16978 . If the error still occur, post the olap stored procedure code here further futher analysis.

    Regards,
    Jerry

    • Marked as answer by bharatkumars87 Wednesday, November 30, 2011 11:26 AM
    Monday, November 28, 2011 6:49 AM
    Moderator
  • You need to make sure that the version of the dll that you used when you built your code is the same that in the GAC on the server and what is registered in SQL Server if it is registered.

    What happens if you copy the correct version of the dll (i.e. the one you built your code with) into the GAC by copying it into C:\Windows\assembly on the SQL Server server. Also, if you have any dlls registered in SQL Server use ALTER ASSEMBLY to make sure that what SQL Server sees is the correct version of the dll that you have in the GAC.

    Essentially when your code is built it, if you have set the "Specific Version" property of the dll set to "true" then the version and signature of the referenced dll is stored and this is used to load the dll from the application folder and/or GAC. If the versions etc. don't match and specific version is true, you will get this error. However, best make sure that you do use the correct version of the dll for the instance you are connecting to.

     


    http://bi-logger.blogspot.com/
    • Marked as answer by bharatkumars87 Wednesday, November 30, 2011 11:24 AM
    Tuesday, November 29, 2011 12:04 PM

All replies

  • It sounds like the assembly isn't registered in your 2008 instance but it is in your 2005 instance. Have you seen the following? http://sqladm.blogspot.com/2011/03/could-not-load-file-or-assembly.html
    http://bi-logger.blogspot.com/
    Friday, November 25, 2011 8:30 AM
  • Hi Phllip,

    Thanks for your valuable comments.
    We alter the assembly as per you suggested. But still we are getting the same error while executing the SP.

    Regards,
    Bharat



    Friday, November 25, 2011 9:05 AM
  • Hmmm, let me double-check here... I assume you have read the article listed in the error message and tried the workarounds yes? i.e. http://support.microsoft.com/kb/949080
    http://bi-logger.blogspot.com/
    Friday, November 25, 2011 1:25 PM
  • Hi Bharat,

    Please navigate to C:\Windows\Assembly and locate Microsoft.AnalysisServices.AdomdClient.dll to check the version number. For 2008 R2, it is 10.0.0.0 required. If no 10.0.0.0, install it by download Microsoft® SQL Server® 2008 R2 ADOMD.NET and running Adomd.NET from http://www.microsoft.com/download/en/details.aspx?id=16978 . If the error still occur, post the olap stored procedure code here further futher analysis.

    Regards,
    Jerry

    • Marked as answer by bharatkumars87 Wednesday, November 30, 2011 11:26 AM
    Monday, November 28, 2011 6:49 AM
    Moderator
  • Lol, thanks Jerry, I guess I should have actually mentioned that the workarounds in http://support.microsoft.com/kb/949080 need to be adapted to 2008, which completely escaped me.

    Though after re-reading the workarounds, I think your solution is the more likely.


    http://bi-logger.blogspot.com/
    Monday, November 28, 2011 8:52 AM
  • Hi Jerry/Philips,

     

    Thanks for your update.

     

     We have verified the version number of microsoft.AnalysisServices.AdomdClient.dll in C:\Windows\Assembly location and found to be 10.0.0.0. Then we have installed .net framework(2,3.5,4 versions) , all cumulative packages related to ADOMD of 2008 R2 and assembly also altered (AnalysisServices.AdomdClient ) successfully. But it ended up in same error while executing the SP.

     

    Please find the screen shot  for the C:\Windows\Assembly location path.

     

    Please find the SP code which is been called :

     

     

    CREATE PROCEDURE [dbo].[ExecuteMDX]

          @Server [nvarchar](4000),

          @Database [nvarchar](4000),

          @SecurityTypeID [int],

          @EffectiveUserName [nvarchar](4000),

          @Query [nvarchar](4000)

    WITH EXECUTE AS CALLER

    AS

    EXTERNAL NAME [ExecuteMDX].[StoredProcedures].[ExecuteMDX]

    GO

     

     

    We will pass a MDX query as input for @Query parameter highlighted above.

     

    FYI: We are able to execute the procedure without issues in SQL Server 2005.

     

    Regards,

    Bharat

    Monday, November 28, 2011 10:39 AM
  • Hmmm, I'm not really sure what the problem is then. Which version and public key token of AdomdClient did you build the stored procedure against? Is it the same as the one on the server?
    http://bi-logger.blogspot.com/
    Tuesday, November 29, 2011 8:35 AM
  • Hi Jerry,

     

    Thanks for your update.

     

    As per your suggestion we found that in SQL Server 2008 R2(10.50.1600.1) Same error occurred while executing the SP but in another server we have SQL server 2008 (10.0.1600.22) is working fine for the same. So it will be version mismatched.

    Whether it is possible to change AnalysisServices.AdomdClient.dll version from 10.50.1600.1 to 10.0.1600.22.

    We have altered the assembly and installed the cumulative package for SQL server 2008 (10.0.1600.22) but 10.50.1600.1 version is not changed.

    Kindly help us on this issue.

     

    Regards,

    Bharat



    Tuesday, November 29, 2011 11:29 AM
  • You need to make sure that the version of the dll that you used when you built your code is the same that in the GAC on the server and what is registered in SQL Server if it is registered.

    What happens if you copy the correct version of the dll (i.e. the one you built your code with) into the GAC by copying it into C:\Windows\assembly on the SQL Server server. Also, if you have any dlls registered in SQL Server use ALTER ASSEMBLY to make sure that what SQL Server sees is the correct version of the dll that you have in the GAC.

    Essentially when your code is built it, if you have set the "Specific Version" property of the dll set to "true" then the version and signature of the referenced dll is stored and this is used to load the dll from the application folder and/or GAC. If the versions etc. don't match and specific version is true, you will get this error. However, best make sure that you do use the correct version of the dll for the instance you are connecting to.

     


    http://bi-logger.blogspot.com/
    • Marked as answer by bharatkumars87 Wednesday, November 30, 2011 11:24 AM
    Tuesday, November 29, 2011 12:04 PM
  • Thanks a lot Philips. As per user suggestion we managed to solve the assembly creation issue in SQL Server 2008 R2 that’s been in existence for long time. Replaced the SQL Server assembly version in the GAC with standard set of procedures.

     

     

    Below are the steps followed to resolve the issue:

    Installing an assembly into GAC

    ·     You can drag and drop dlls into GAC by changing the Local Security Policy on the Win2008 server.

    1. Start>> Run >> write secpol.msc

    2. Expand "Local Policies" >> Click "Security Options"

    3. Right click on "User Account Control: run all administrators in Admin Approval Mode" , select "Properties"

    4. Disable it. Click OK.

    5. Restart windows

    Check gacutil.exe 

    1. First check that if server is of 32 bit or 64 bit?

    2. If it is 64 bit then open folder “C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64“

    3. But if it is 32 bit then open folder “C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin“

    4. Copy 2 files i.e. gacutil.exe & gacutil.exe.config

    5. Paste these files to above location of the server.

    6. Your gacutil.exe is now ready to run and u can install assembly in to GAC using this small utility.

     

    Installing Assembly using gacutil.exe 

    1. Start>>Run>>cmd (Run as administrator)

    2. If it is 64 bit then open folder “C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64“

    3. Type cd C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64

    4. if it is 32 bit then open folder “C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin“

    5. Type cd C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin

    6. Press enter

    7. Type gacutil.exe /i

    8. Copy paste below two attached file in D:\

    9. Type gacutil –if "D:\Microsoft.AnalysisServices.AdomdClient.dll" in cmd, press enter.

    10. Also type gacutil –if "D:\Microsoft.AnalysisServices.dll" in cmd, press enter.

    The above procedures will resolve this issue.

     

    Regards,

    Bharat

     


    Wednesday, November 30, 2011 11:24 AM
  • Hi Bharat,

    I am trying to install SQL Server 2008 Enterprise Edition and it looks like I am coming across the same issue. It gives me error for Microsoft.AnalysisServices.AdmondClient.dll.

    I can see I have Microsoft.AnalysisServices.AdmondClient.dll in C:\Windows\assembly and the version of this file is 11.0.0.0.

    Can you please help me to resolve this issue?

    Thanks,

    Junaid

    Sunday, July 21, 2013 7:19 PM
  • System.IO.FileLoadException: Could not load file or assembly 'Microsoft.AnalysisServices.AdomdClient, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' 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:

    I am getting the same error and I can see GAC and .NET framework assembly version are same.

    My Code was built having a different build number for Analysisservices.ADomdclient.dll though which is 11.0.2100.60. But the code was built with dll property - Specific version set to False and Unsafe_access as TRUE.

    The assembly version in GAC and %Windir%\Microsoft.NET\Framework\<var>Version is 11.0.3381.0 and .NET framework installed in 4.0. Not sure if build number also causes the issue.

    Tuesday, January 28, 2014 8:12 AM
  • My application reside  on my win 10 with VS 2008  and sql server on server 2012 r >>>>

      but application reside  on local pc.

    Any help is wel come.

    Vijay


    Vijay

    Monday, February 27, 2017 10:31 PM
  • what is the correct version  for Microsoft.AnalysisServices.AdomdClient.dll for VS 2008 on win 10????

    Vijay

    Monday, February 27, 2017 10:34 PM
  • I Had this issue when I used another project as DLL, which had different version of this file

    Error was due to Main Project using different version that DLL was referencing

    Occurred when We updated SQL MGT Studio

    Solution: Recompile DLL Project , then use new dll

    Monday, October 29, 2018 2:18 PM