Blog » SQL Server » Could not load file or assembly ‘Microsoft.SqlServer.Diagnostics.STrace’

Could not load file or assembly ‘Microsoft.SqlServer.Diagnostics.STrace’

You may receive the following error while starting SQL server 2008 Management Studio:

The type initializer for 'Microsoft.SqlServer.Management.Dmf.PolicyStore' threw an exception. (Microsoft.SqlServer.Dmf)
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.

In most cases, uninstalling Visual studio and .Net 4 and reinstalling them fix the problem. In case if it does not resolve the issue you can follow the below steps to resolve this error:

1. Run Command Prompt and find the location of the DLL file using the following command:

dir Microsoft.SqlServer.Diagnostics.STrace.dll /s

2. Copy the location with the DLL name.

3. Run VS 2008 Command Prompt as Administrator.

4. Execute the following

GACUTIL –i “{Location of Microsoft.SqlServer.Diagnostics.STrace.dll} found at step 1”

If the DLL file Microsoft.SqlServer.Diagnostics.STrace.dll is missing on your system, you may, however, copy it from other working system.

Hopefully this should resolve the error.

1 thought on “Could not load file or assembly ‘Microsoft.SqlServer.Diagnostics.STrace’”

Leave a Comment

Your email address will not be published. Required fields are marked *