Referencing SMO

Jan 30, 2009 at 3:14 PM
I have a side by side 2005 and 2008 install of SMO and was having all kinds of problems getting the right assembly referenced in my .tt files. I finally had to resort to

<#@

assembly name="Microsoft.SqlServer.ConnectionInfo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" #>

 

<#@

assembly name="Microsoft.SqlServer.Smo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" #>

 

<#@

assembly name="Microsoft.SqlServer.Management.Sdk.Sfc, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" #>

 


Being really explicit with the versions I'd referenced. It really only came into play once I added a reference to a custom assembly (which it seemed that I had to GAC to use (???)), that custom assembly made use of SMO 10. The assembly directive in my t4 project was defaulting to 9.x.x.x.x.x ... Assembly Redirection might wreak havoc on my sql server installs, so that wasn't an option.
Coordinator
Jan 31, 2009 at 11:38 AM
Thanks for posting this information.