none
SSMS 2008 on Windows 7 throws exception when connecting Object Explorer

    Question

  • I've got a fresh install of Windows 7 Pro, SQL Server 2008 Developer edition, and a pre-release version VSTS 2010. I updated SQL 2008 to SP1 and updated the Books Online.

    When I try to connect Object Explorer to the local instance, I get the following exception:

    ===================================
    
    The type initializer for 'Microsoft.SqlServer.Management.Dmf.PolicyStore' threw an exception. (Microsoft.SqlServer.Dmf)
    
    ------------------------------
    Program Location:
    
       at Microsoft.SqlServer.Management.Dmf.PolicyStore..ctor(SfcConnection connection)
       at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.NavigableItem.get_State()
    
    ===================================
    
    Could not load file or assembly 'Microsoft.SqlServer.Diagnostics.STrace, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified. (Microsoft.SqlServer.Dmf)
    
    ------------------------------
    Program Location:
    
       at Microsoft.SqlServer.Management.Dmf.PolicyStore..cctor()
    
    


    I believe that I've fixed the problem by copying C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\Microsoft.SqlServer.Diagnostics.STrace to C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSSHell\Common7\IDE.

    That seems to make the exception go away, but I wanted to make you aware of this.
    Tuesday, August 11, 2009 10:29 PM

Answers

  • I thought I would put my 2 cents worth in because I spent too long trying to solve this, and my solution isn't exactly the same as those above (even though I tried them all) and by posting this I hope to help others who may have been stuck like me.

    This problem occurred after I uninstalled SQL Server 2008 R2 and installed SQL Server 2008 (don't ask why I had to do that.  It's an unusual downgrade path so maybe that is what caused by solution to differ slightly from those above). 

    The problems I had were:

    1. SSMS displayed an error on startup, but continued working (apparently)

    2. The Management node in SSMS didn't work

    3. SSIS projects created in 2008 R2 (particulary the data flow tasks) displayed the same error msg and wouldn't work (they wouldn't even load)

    Basically the problem was that microsoft.sqlserver.diadnostics.strace.dll was not installed in the GAC.  Furthermore, this file was not on my server, and not on the installation DVDs, so I couldn't install it.  I found it on my PC at home, but there was a trick to getting to my work server.

    On my home PC, the DOS command DIR microsoft.sqlserver.diagnostics.strace.dll /s revealed it was in c:\Windows\Assembly\GAC_MSIL However the folder GAC_MSIL is not visible in windows explorer.  The trick I found was to use the DOS copy command to copy the dll to somewhere else (C:\ for instance) then transport it from there to my work server (by email or whatever) ie:

    copy c:\windows\assembly\gac_msil\microsoft.sqlserver.diagnostics.strace.dll  c:\

    After transporting it to C:\ on my work server it could be installed using gacutil.exe.  ie

    1. Change to dir containing gacutil.exe (in my case c:\program Files\Microsoft SDKs\Windows\v6.0A\bin)

    2. gacutil -i c:\microsoft.sqlserver.diadnostics.strace.dll

     

    Sunday, February 06, 2011 11:04 PM
  • I completely uninstalled VS2010 beta and .NET 4.0, then re-installed the the VS2010 RC & it fixed it.

    -Ken

    Thursday, February 11, 2010 12:04 AM

All replies

  • I've got the same exact problem.
    Cheers, Karl - Microsoft Product Team, Code Project MVP - http://karlshifflett.wordpress.com/
    Friday, August 14, 2009 2:15 AM
  • I've sent a message to the sql server team.  Will update when I get a reply.
    Cheers, Karl - Microsoft Product Team, Code Project MVP - http://karlshifflett.wordpress.com/
    Friday, August 14, 2009 2:40 AM
  • Hi Richard

    Based on the current information, it is possible that the original installation for the sql 2008 clinet tool is not completed totally/corrupted; so to copy the required file to the correct location fixed the problem.

    Thank you for public the questions and resolution here.

    Besides, according to the error messsage, we could use the process monitor to figure out the cause of the update problem. For more information about the process monitor:

    Process Monitor:

    Please try the ProcMon utility to monitor the process/NTFS/registry operations while reproducing the problem. You can download it from:

    http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/processmonitor.mspx

     

    Here are the detailed steps:

    -- Log on Windows as administrator

    -- Unzip the file and run the Procmon.exe file.
    --<…Try to reproduce the problem…>

    -- Stop the capture and save it as .PML format. Send the file to me.



    Have a nice day.

    Regards
    Mark Han
    Friday, August 14, 2009 3:28 AM
  • Richard,

    If forwarded your fix to the SQL Team.  They are working to find how this happened and should have an answer soon.

    Cheers,

    Karl
    Cheers, Karl - Microsoft Product Team, Code Project MVP - http://karlshifflett.wordpress.com/
    Sunday, August 16, 2009 2:30 PM
  • I've had the same issue twice (I have a fresh install of Windows 7 RTM and SQL Server 2008 SP1 and the latest LCTP of VS2010) and Richards fix worked for me I noe have a new issue very similar.
    If I try to do a export (Right clik DB -> Tasks->Exports Data... and click Next) of a DB I get this error:
    TITLE: SQL Server Import and Export Wizard
    ------------------------------

    Cannot get string literals from the database connection "Provider=SQLNCLI10;Data Source=(local);Integrated Security=SSPI;Auto Translate=false;Initial Catalog=NursingMetadata".

    ------------------------------
    ADDITIONAL INFORMATION:

    Could not load file or assembly 'Microsoft.SqlServer.Diagnostics.STrace, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified. (Microsoft.SqlServer.SqlTDiagM)

    ------------------------------
    BUTTONS:

    OK
    ------------------------------

    And I havent been able to find a fix for it.

    Stephen J. Naughton

    Sunday, August 16, 2009 5:48 PM
  • Thanks Karl. I didn't want to make too big a deal out of this because it's LCTP1 of VS2010. If it had been a proper Beta, then I would have contacted the PG directly.

    -Rich
    Wednesday, August 19, 2009 5:08 PM
  • I had similar problem, after un-installing Beta VSTS2010 and installing LCTP, copying the file (as Richard has suggested) has fixed the issue
    Friday, August 21, 2009 3:03 PM
  • I'm having the same problem except that the file "Microsoft.SqlServer.Diagnostics.STrace.dll" is nowhere to be found on my system now.  I've tried reinstalling various components but none of them seem to contain the missing file.

    What component(s) or application(s) install this file to begin with?  I.e., what do I need to reinstall?  Where else can I find the file?

    Thanks,

    -Ken
    Tuesday, February 09, 2010 11:51 PM
  • I have the same problem.  And like Ken I don't have the file on my system.  There are a couple of minor differences in my case. One difference is that I have visual studio 2008 not 2010.  The other is that I am working Windows Server 2008.  How can we get the appropriate DLL?

    Rob
    Wednesday, February 10, 2010 6:53 PM
  • I have this same exact issue, been looking since last night, cant find a solution or the replacement file...help?
    Wednesday, February 10, 2010 8:26 PM
  • I completely uninstalled VS2010 beta and .NET 4.0, then re-installed the the VS2010 RC & it fixed it.

    -Ken

    Thursday, February 11, 2010 12:04 AM
  • Good news Ken.  In what order did you install things?  I think that may be critical.
    • Proposed as answer by Kawyn1 Wednesday, August 18, 2010 1:40 PM
    Thursday, February 11, 2010 5:03 PM
  • I thought I would put my 2 cents worth in because I spent too long trying to solve this, and my solution isn't exactly the same as those above (even though I tried them all) and by posting this I hope to help others who may have been stuck like me.

    This problem occurred after I uninstalled SQL Server 2008 R2 and installed SQL Server 2008 (don't ask why I had to do that.  It's an unusual downgrade path so maybe that is what caused by solution to differ slightly from those above). 

    The problems I had were:

    1. SSMS displayed an error on startup, but continued working (apparently)

    2. The Management node in SSMS didn't work

    3. SSIS projects created in 2008 R2 (particulary the data flow tasks) displayed the same error msg and wouldn't work (they wouldn't even load)

    Basically the problem was that microsoft.sqlserver.diadnostics.strace.dll was not installed in the GAC.  Furthermore, this file was not on my server, and not on the installation DVDs, so I couldn't install it.  I found it on my PC at home, but there was a trick to getting to my work server.

    On my home PC, the DOS command DIR microsoft.sqlserver.diagnostics.strace.dll /s revealed it was in c:\Windows\Assembly\GAC_MSIL However the folder GAC_MSIL is not visible in windows explorer.  The trick I found was to use the DOS copy command to copy the dll to somewhere else (C:\ for instance) then transport it from there to my work server (by email or whatever) ie:

    copy c:\windows\assembly\gac_msil\microsoft.sqlserver.diagnostics.strace.dll  c:\

    After transporting it to C:\ on my work server it could be installed using gacutil.exe.  ie

    1. Change to dir containing gacutil.exe (in my case c:\program Files\Microsoft SDKs\Windows\v6.0A\bin)

    2. gacutil -i c:\microsoft.sqlserver.diadnostics.strace.dll

     

    Sunday, February 06, 2011 11:04 PM
  • What is the resolution for this issue?

    Where can we find the STrace.dll?

    Jeff

    Monday, May 02, 2011 6:19 PM
  • I had a similar experience.  Long story, but I had 2008 SP2 x64 installed and performed an in-place upgrade to 2008 R2 x64.  Bad idea, because it failed.  So I uninstalled completely and installed R2 x64 fresh using the advanced services x64 install package that was released on 6-19-11.  That installed fine, but I had all sorts of permissions issues when attaching databases, so I decided to uninstall and go back to 2008 SP2 x64.  Uninstalled R2 and installed 2008 fresh, applied SP2 with no issues.  Now I'm having the same issue described above, where SSMS whines on connect to the database engine, saying that microsoft.sqlserver.diagnostics.strace.dll is missing.  I searched my computer and could not locate this file anywhere.  What am I to do?
    Tuesday, June 21, 2011 1:00 AM
  • Same problem on WinXP SP3 with SQL Server Express 2008.  It was happening when i opened SQL Server Management Studio 2008.  I saw another post about installing the Microsoft® SQL Server® 2008 R2 Shared Management Objects to get the "missing" dllThese objects are found at http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=16978  This was a small and quick install, not sure what it did, but it put the needed dll file in this odd directory and I ran the following copy command to get it out from hidden location to c: root where it could be acted on by aforementioned command gacutil, as mentioned in other posts:   

    C:\>copy c:\windows\assembly\gac_msil\microsoft.sqlserver.diagnostics.strace\10.
    0.0.0__89845dcd8080cc91\microsoft.sqlserver.diagnostics.strace.dll c:\

    Find where gacutil.exe is and cd to that location and then run this command at that location:

    C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin>gacutil -i c:\microsoft.sqlser
    ver.diadnostics.strace.dll

    This is what results from that command:

    Microsoft (R) .NET Global Assembly Cache Utility.  Version 3.5.30729.1
    Copyright (c) Microsoft Corporation.  All rights reserved.

    Assembly successfully added to the cache

    Sunday, September 25, 2011 5:18 AM
  • I have this same exact issue, been looking since last night, cant find a solution  
    Tuesday, October 11, 2011 2:35 PM
  • i had similar issue , did you get any answer thanks born sql
    Tuesday, October 11, 2011 2:36 PM
  • The problem was with SSMS.  I downloaded SP1 of SSMS and installed it.  Problem solved.
    Tuesday, October 11, 2011 6:50 PM
  • For anyone frustrated out here who is trying to find the download location of the GACUTIL file on Microsoft's web site, you will find it here:  http://www.microsoft.com/download/en/details.aspx?id=8442

    This is the ISO download for the Windows SDK v7.1.  Once you extract it and run the install on your PC / Server, you will have GACUTIL at your disposal.  I was able to finally resolve the issue once I successfully installed this download. 

    It is 10/31/2011.  Microsoft should have a hot fix for this problem by now.  Instead, they pointed me to this MSDN blog for help!

    • Proposed as answer by Naomi NEditor Monday, October 31, 2011 5:02 PM
    Monday, October 31, 2011 4:20 PM
  • apozdol, Thank you very much (and the others that suggested some of the same steps).  In my case I was eceiving the error on the laptop that just had SQL Server 2008 only and not SQL Server 2008 R2 also (Windows 7 x64).  The Windows 7 x64 laptop that had both SQL Server products on it wasn't issuing the error.  Also, a Windows 7 x86 desktop with both 2008 and 2008 R2 wasn't issuing the error either.  I followed your steps exactly and everything worked perfectly.  The only difference was my gacutil was in v6.0a.  This stuff is pretty esoteric!  Thanks again, Mark

    Thursday, February 16, 2012 2:29 AM
  • Apozdol did it for me, and it seemed to be the simplest solutuion as well

    jnc

    Tuesday, March 27, 2012 4:04 PM