error while SQL - Deploy DACPAC - Could not find the file: Microsoft.SqlServer.TransactSql.ScriptDom.dll

sumanbanka's Avatar

sumanbanka

08 Jan, 2018 06:18 AM

Hi, I am trying to deploy dacpac using template SQL- Deploy DACPAC.
But I am getting errors like
Could not load file or assembly 'file:///C:\Program Files\Microsoft SQL Server\130\Microsoft.SqlServer.TransactSql.ScriptDom.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Microsoft.PowerShell.Commands.AddTypeCommand.LoadAssemblyFromPathOrName(List`1 generatedTypes)
at Microsoft.PowerShell.Commands.AddTypeCommand.EndProcessing()
at System.Management.Automation.CommandProcessorBase.Complete()
The remote script failed with exit code 1

  1. Support Staff 1 Posted by Robert Wagner on 09 Jan, 2018 12:26 AM

    Robert Wagner's Avatar

    Hi,

    Thank you for getting in touch.

    The most l likely issue is that that dll is blocked, see https://stackoverflow.com/questions/34400546/could-not-load-file-or...

    Also the error is different in the attached error log. It looks like the required SQL Server dlls are not on the machine,

    Does the DacPac deploy work when you do it manually on that machine (ie not using Octopus)?

    Rob W

  2. 2 Posted by sumanbanka on 13 Jan, 2018 11:41 AM

    sumanbanka's Avatar

    Thanks Robert. Will try to unblock the dll.
    The required SQL dll is present on the machine. I have installed SSDT as well on the machine. And the DacPac deploy works well using sqlpackage.exe on that machine ie the package gets deployed.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • ServerTask-19048_log.txt 13.7 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac