question

VivekGupta-9252 avatar image
0 Votes"
VivekGupta-9252 asked RichMatheisen-8856 edited

Could not load file or assembly 'Microsoft.SqlServer.Dmf.Common, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies

Hi,

I am trying to execute a SSIS Package using PowerShell Script by following instructions mentioned in https://docs.microsoft.com/en-us/sql/integration-services/ssis-quickstart-deploy-powershell?view=sql-server-ver15

I have tried using the following commands to load Microsoft.SQLServer.Management.IntegrationServices.dll

$loadStatus = [System.Reflection.Assembly]::Load("Microsoft.SQLServer.Management.IntegrationServices.dll, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL")

$loadStatus = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SQLServer.Management.IntegrationServices") | Out-Null;

$loadStatus = [System.Reflection.Assembly]::LoadFrom("C:\Microsoft.SQLServer.Management.IntegrationServices.dll") | Out-Null

However, I get the following error:

New-Object : Could not load file or assembly 'Microsoft.SqlServer.Dmf.Common, Version=13.0.0.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
+ ... nServices = New-Object $SSISNamespace".IntegrationServices" $sqlConne ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-Object], FileNotFoundException
+ FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.NewObjectCommand

I don't have Microsoft.SqlServer.Dmf.Common.dll Version=13.0.0.0 in my machine.

Please let me know the solution for this error.

Thanks in advance.

windows-server-powershell
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Do you have another version of the DLL on your machine? The link you provided shows the PowerShell script loading version 14.0.0.0, not 13.0.0.0.

0 Votes 0 ·

I have Microsoft.SqlServer.Dmf.Common.dll version 13.0.15700.64 on my machine.

0 Votes 0 ·

If the exact version (and PublicKeyToken, etc.) in the string supplied to the Load method cannot be satisfied, the Load will fail. Try it with just the name of the file. That should work pretty much like the now-deprecated LoadWithPartialName method.

0 Votes 0 ·

1 Answer

IanXue-MSFT avatar image
0 Votes"
IanXue-MSFT answered

Hi,

Have you ever tried Add-Type? 'Microsoft.SqlServer.Dmf.Common, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' is the strong name of the assembly. You could check it using the GetAssemblyName method.

 [System.Reflection.AssemblyName]::GetAssemblyName($path).fullname

Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.