After we upgraded our SQL Server from 2017 to 2019. We could deploy DACPAC to our SQL Server instance we have this error
Unable to find DACPAC assemblies in C:\Program Files\Microsoft SQL Server\150 C:\Program Files (x86)\Microsoft SQL Server\150 or child folders, attempting to use SqlServer PowerShell module …
June 8th 2023 18:51:20
Info
PowerShell module SqlServer not present, downloading temporary copy …
June 8th 2023 18:51:58
Info
Importing module SqlServer …
June 8th 2023 18:51:58
Info
System.Management.Automation.MethodInvocationException: Exception calling “LoadFile” with “1” argument(s): “The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018)” —> System.BadImageFormatException: The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018)
June 8th 2023 18:51:58
Info
at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
June 8th 2023 18:51:58
Info
at System.Reflection.Assembly.LoadFile(String path)
June 8th 2023 18:51:58
Info
at CallSite.Target(Closure , CallSite , Type , Object )
June 8th 2023 18:51:58
Info
— End of inner exception stack trace —
June 8th 2023 18:51:58
Info
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
June 8th 2023 18:51:58
Info
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
June 8th 2023 18:51:58
Info
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
June 8th 2023 18:51:58
Info
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
June 8th 2023 18:51:58
Error
NotSpecified: Exception calling “LoadFile” with “1” argument(s): “The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018)”
June 8th 2023 18:51:58
Error
At C:\Octopus\Work\20230608225213-165341-1011\Script.ps1:64 char:9
June 8th 2023 18:51:58
Error
- [Reflection.Assembly]::LoadFile($assemblyFile.FullName) | Out …
June 8th 2023 18:51:58
Error
June 8th 2023 18:51:58
Error
at Load-SqlServerAssmblies, C:\Octopus\Work\20230608225213-165341-1011\Script.ps1: line 64
June 8th 2023 18:51:58
Error
at Add-DACAssemblies, C:\Octopus\Work\20230608225213-165341-1011\Script.ps1: line 229
June 8th 2023 18:51:58
Error
at Invoke-DacPacUtility, C:\Octopus\Work\20230608225213-165341-1011\Script.ps1: line 405
June 8th 2023 18:51:58
Error
at , C:\Octopus\Work\20230608225213-165341-1011\Script.ps1: line 663
June 8th 2023 18:51:58
Error
at , : line 1
June 8th 2023 18:51:58
Error
at , C:\Octopus\Work\20230608225213-165341-1011\Octopus.FunctionAppenderContext.ps1: line 211
June 8th 2023 18:51:58
Error
at , C:\Octopus\Work\20230608225213-165341-1011\Bootstrap.Octopus.FunctionAppenderContext.ps1: line 5478
June 8th 2023 18:51:59
Error
at , : line 1
June 8th 2023 18:51:59
Error
at , : line 1
June 8th 2023 18:51:59
Fatal
The remote script failed with exit code 1