home articles news code blog links search  
 
         
  Code Samples

Articles and Presentations

sqldbatips.com blog

 
Workaround for compiling SMO applications with SQL 2005 Express Edition

Author Jasper Smith Hits 2177
Create Date 22-08-2004 Last Updated 22-08-2004
Versions SQL2005    

Overview

There is an issue with the setup of SQL Server 2005 Express Edition with regard to the SMO assemblies required to compile SMO applications. Note that this does not affect the ability to run SMO applications, merely to compile them. The issue is that the required SMO assemblies are only installed in the GAC and are not available to be referenced when compiling an SMO application. Whilst I'm sure there has to be an easier way, the method below worked fine for me and it's a one time operation.

Extracting SMO assemblies

1) Create the folder C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies (whilst it could be any folder, this is where the assemblies would normally reside)

2) Open regedit (Start>Run>regedit) and navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion

3) Add a new Binary Value named DisableCacheViewer and set it to a non zero value e.g. 10

4) In Windows Explorer browse to the folder C:\WINDOWS\assembly\GAC_MSIL. You will see subfolders for each of the SMO asemblies required

  • Microsoft.SqlServer.ConnectionInfo
  • Microsoft.SqlServer.Smo
  • Microsoft.SqlServer.SmoEnum
  • Microsoft.SqlServer.SqlEnum
  • Microsoft.SqlServer.RegSvrEnum
  • Microsoft.SqlServer.ServiceBrokerEnum
  • 5) For each folder, browse down to the subfolder 9.0.242.0__89845dcd8080cc91 under which you will find the required assembly. For example if we take the Microsoft.SqlServer.Smo.dll assembly, it can be found in the 9.0.242.0__89845dcd8080cc91 subfolder of C:\WINDOWS\assembly\GAC_MSIL\Microsoft.SqlServer.Smo

    6) Copy the assembly (dll) from each subfolder to the folder created in Step 1

    7) Use regedit to either delete the DisableCacheViewer value created in Step 3 or set its value to 0

    Related Articles

       Getting Started with SMO in SQL 2005
       Getting Started with SMO in SQL 2005 - Backups
       Getting Started with SMO in SQL 2005 - Restores
       Getting Started with SMO in SQL 2005 - Integrity Checks
       Getting Started with SMO in SQL 2005 - Verifying Backups

    Print this page  Print this page Email this article  Email this article Add to Favourites  Add to Favourites
     
             
    © Copyright sqldbatips Ltd 2008. Contact webmaster home | news | articles | code | blog | links | search  

    free tracking