Deploy SSIS with Powershell - Missing DMF

Yassir 201 Reputation points
2022-07-07T16:10:10.273+00:00

Hello,

I am trying to deploy ssis package using powershell, when i execute the file i have the error as bellow :

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.

The powershell as below :

# Variables  
$SSISNamespace = "Microsoft.SqlServer.Management.IntegrationServices"  
$TargetServerName = "MIIS-V-1"  
$TargetFolderName = "Test_Deploy"  
$ProjectFilePath = "C:\etl\myETL.ispac"  
$ProjectName = "Test_Deploy"  
  
# Load the IntegrationServices assembly  
$loadStatus = [System.Reflection.Assembly]::Load("Microsoft.SQLServer.Management.IntegrationServices, "+  
    "Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL")  
#Tested also with that :   
#$loadStatus =[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Management.IntegrationServices")  
  
  
# Create a connection to the server  
$sqlConnectionString = "Data Source=" + $TargetServerName + ";Initial Catalog=master;Integrated Security=SSPI;"  
$sqlConnection = New-Object System.Data.SqlClient.SqlConnection $sqlConnectionString  
  
# Create the Integration Services object  
$integrationServices = New-Object $SSISNamespace".IntegrationServices" $sqlConnection  
  
# Get the Integration Services catalog  
$catalog = $integrationServices.Catalogs["SSISDB"]  
  
# Create the target folder  
$folder = New-Object $SSISNamespace".CatalogFolder" ($catalog, $TargetFolderName,  
    "Folder description")  
$folder.Create()  
  
Write-Host "Deploying " $ProjectName " project ..."  
  
# Read the project file and deploy it  
[byte[]] $projectFile = [System.IO.File]::ReadAllBytes($ProjectFilePath)  
$folder.DeployProject($ProjectName, $projectFile)  
  
Write-Host "Done."  

I checked the folder and i see that i have the dll in the path as below

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Extensions\Microsoft\SQLCommon\140

Any idea to fix that ?

Thanks for help !!

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,702 questions
Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ZoeHui-MSFT 41,491 Reputation points
    2022-07-08T06:04:40.143+00:00

    Hi @Yassir ,

    I'm not familiar with powershell.

    Based on the research, here is a same thread, you may take a reference to see if it could be helpful.

    deploy-ssis-with-powershell-missing-dmf

    Please check the version of the dll is match or not.

    Regards,

    Zoe


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    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.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.