我正在运行
Export-DbaInstance -SqlInstance $sourceServerName -Path $absPathToBackupScriptDir
并收到错误"无法加载文件或程序集"Microsoft.SqlServer.ConnectionInfo"
我尝试为Visual Studio 2013和2017安装Visual C++可再发行Microsoft
我尝试使用下面的CMD将有问题的DLL(包含在DbaTools模块中(添加到GAC
gacutil.exe /i "C:Program FilesWindowsPowerShellModulesdbatoolsbinsmoMicrosoft.SqlServer.ConnectionInfo.dll"
我尝试使用下面的Powershell安装最新版本的DbaTools(~0.9.x(
Invoke-Expression (Invoke-WebRequest -UseBasicParsing https://dbatools.io/in)
输入的命令和完整的输出错误消息都在下面
Export-DbaInstance -SqlInstance $sourceServerName -Path $absPathToBackupScriptDir
'Could not load file or assembly 'Microsoft.SqlServer.ConnectionInfo' Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91 or one of its dependencies. The system cannot find the file specified.'
如果我选择不导出复制设置,则不会尝试加载有问题的程序集,并且 cmdlet 将按预期运行。
Export-DbaInstance -SqlInstance $sourceServerName -Path $absPathToBackupScriptDir -Exclude 'ReplicationSettings'