1
Vote

Win7 x64 + SQL2012 rtm load errors for DTS and RMO

description

I have this fresh install of Win7 x64 with only a client install ( except the add-in s ) of SQL2012.
(My PowerGUI has been configured to actually use Powershell V3.0)

Now, when I load SQLPSx it generates following errors:

add-type : Could not load file or assembly 'Microsoft.SqlServer.Rmo, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The s
ystem cannot find the file specified.
At C:\Users\ADM-B0729\Documents\WindowsPowerShell\Modules\Repl\Repl.psm1:17 char:8
  • catch {add-type -AssemblyName "Microsoft.SqlServer.Rmo"}
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [Add-Type], FileNotFoundException
    • FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.AddTypeCommand
No Oracle found
Loading SQLPSX Module - SQLmaint
Loading SQLPSX Module - SQLServer
Loading SQLPSX Module - Agent
Loading SQLPSX Module - Repl
Loading SQLPSX Module - SSIS
add-type : Cannot add type. The assembly 'Microsoft.SqlServer.ManagedDTS, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' could not be found.
At C:\Users\ADM-B0729\Documents\WindowsPowerShell\Modules\SSIS\SSIS.psm1:21 char:5
  • add-type -AssemblyName "Microsoft.SqlServer.ManagedDTS, Version=10.0.0.0, Cu ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : ObjectNotFound: (Microsoft.SqlSe...9845dcd8080cc91:String) [Add-Type], Exception
    • FullyQualifiedErrorId : ASSEMBLY_NOT_FOUND,Microsoft.PowerShell.Commands.AddTypeCommand
add-type : Cannot add type. One or more required assemblies are missing.
At C:\Users\ADM-B0729\Documents\WindowsPowerShell\Modules\SSIS\SSIS.psm1:21 char:5
  • add-type -AssemblyName "Microsoft.SqlServer.ManagedDTS, Version=10.0.0.0, Cu ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidData: (:) [Add-Type], InvalidOperationException
    • FullyQualifiedErrorId : ASSEMBLY_LOAD_ERRORS,Microsoft.PowerShell.Commands.AddTypeCommand
Loading SQLPSX Module - Showmbrs
Loading SQLPSX Module - SQLParser
Loading SQLPSX Module - adolib
Loading SQLPSX Modules is Done!


I altered following SQLPSx components to be able to get the load done without errors:

I've altered the repl.psm1 so it uses the 11.0 types

try {add-type -AssemblyName "Microsoft.SqlServer.ConnectionInfo, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" -EA Stop}
catch {add-type -AssemblyName "Microsoft.SqlServer.ConnectionInfo"}
try {add-type -AssemblyName "Microsoft.SqlServer.Rmo, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" -EA Stop}
catch {add-type -AssemblyName "Microsoft.SqlServer.Rmo"}

For the DTS stuff I altered the SSIS.psm1 so it uses:

if ( $Args[0] -eq 2005 )
{
add-type -AssemblyName "Microsoft.SqlServer.ManagedDTS, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"
#add-type -Path "C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.SQLServer.ManagedDTS.dll"
}
elseif ( $Args[0] -eq 2008 )
{
add-type -AssemblyName "Microsoft.SqlServer.ManagedDTS, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"
#add-type -Path "C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies\Microsoft.SQLServer.ManagedDTS.dll"
}
else
{
add-type -AssemblyName "Microsoft.SqlServer.ManagedDTS, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"
#add-type -Path "C:\Program Files\Microsoft SQL Server\110\SDK\Assemblies\Microsoft.SQLServer.ManagedDTS.dll"
}


Now SQLPSx doesn't show errors at load time.

I hope that was all it needed.

comments

MikeShepard wrote Jan 30 at 2:34 AM

I actually have some similar code written to handle this using a parameter to specify a version, or if no parameter was passed, to loop through versions backwards from 15 down to 9 and try to load the modules using those assemblies.