0
Octopus를 사용하여 데이터베이스와 함께 MVC 프로젝트를 배포하고 있습니다. Deploy.ps1는 SQL 프로젝트는 SQL 서버 난 2012 년 목표로오류 SQL72018 : 데이터베이스 옵션을 가져올 수 없습니다.
# Add the DLL
# For 64-bit machines
Write-Host "Add Types"
Add-Type -path ((Get-Item -Path ".\" -Verbose).FullName + "\bin\Microsoft.SqlServer.Dac.dll")
Add-Type -path ((Get-Item -Path ".\" -Verbose).FullName + "\bin\Microsoft.SqlServer.TransactSql.ScriptDom.dll")
# Create the connection string
$services = New-Object Microsoft.SqlServer.Dac.DacServices ("Data Source=$dbSource;User Id=$dbAdminUser;Password=$dbAdminPassword")
Write-Host "Load the dacpac " + ((Get-Item -Path ".\" -Verbose).FullName + "\Resources\Database.publish.xml")
#Load the dacpac
$dacpac = ((Get-Item -Path ".\" -Verbose).FullName + "\Resources\Database.dacpac")
$dacpacoptions = ((Get-Item -Path ".\" -Verbose).FullName + "\Resources\Database.publish.xml")
#Load dacpac from file & deploy to database
$dp = [Microsoft.SqlServer.Dac.DacPackage]::Load($dacpac)
Write-Host "dacProfile set"
#Read a publish profile XML to get the deployment options
$dacProfile = [Microsoft.SqlServer.Dac.DacProfile]::Load($dacpacoptions)
Write-Host "Add dbUser"
$dacProfile.DeployOptions.SqlCommandVariableValues["dbUsername"] = $dbUser
Write-Host "Add dbPassword"
$dacProfile.DeployOptions.SqlCommandVariableValues["dbPassword"] = $dbPassword
Write-Host "About to deploy the dacpac"
# Deploy the dacpac
$services.Deploy($dp, $dbName, $TRUE, $dacProfile.DeployOptions)
# Configure IIS
.\DeployScripts\IISConfiguration.ps1
파일 있어요 여기
An error occurred during deployment plan generation. Deployment cannot continue.
Error SQL72018: Database Options could not be imported but one or more of these objects exist in your source.
at Microsoft.SqlServer.Dac.DacServices.CreateController(SqlDeployment deploymentEngine, ErrorManager errorManager)
at Microsoft.SqlServer.Dac.DeployOperation.<>c__DisplayClass3.<>c__DisplayClass5.<CreatePlanInitializationOperation>b__1()
at Microsoft.Data.Tools.Schema.Sql.Dac.OperationLogger.Capture(Action action)
at Microsoft.SqlServer.Dac.DeployOperation.<>c__DisplayClass3.<CreatePlanInitializationOperation>b__0(Object operation, CancellationToken token)
at Microsoft.SqlServer.Dac.Operation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
at Microsoft.SqlServer.Dac.ReportMessageOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
at Microsoft.SqlServer.Dac.OperationExtension.CompositeOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
at Microsoft.SqlServer.Dac.OperationExtension.CompositeOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
at Microsoft.SqlServer.Dac.OperationExtension.CompositeOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
at Microsoft.SqlServer.Dac.DeployOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
at Microsoft.SqlServer.Dac.OperationExtension.Execute(IOperation operation, DacLoggingContext loggingContext, CancellationToken cancellationToken)
at Microsoft.SqlServer.Dac.DacServices.InternalDeploy(IPackageSource packageSource, Boolean isDacpac, String targetDatabaseName, DacDeployOptions options, CancellationToken cancellationToken, DacLoggingContext loggingContext)
at Microsoft.SqlServer.Dac.DacServices.Deploy(DacPackage package, String targetDatabaseName, Boolean upgradeExisting, DacDeployOptions options, Nullable`1 cancellationToken)
at CallSite.Target(Closure , CallSite , Object , Object , Object , Boolean , Object)
Errors occurred while modeling the target database. Deployment can not continue.
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.ThrowIfErrors(String message, ErrorManager errors, Object category)
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentEndpointServer.OnLoad(ErrorManager errors, DeploymentEngineContext context)
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.PrepareModels()
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.InitializePlanGeneratator()
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.CreateController(Action`1 msgHandler)
at Microsoft.SqlServer.Dac.DacServices.CreateController(SqlDeployment deploymentEngine, ErrorManager errorManager)
: 데이터베이스를 배포하기위한 단계가 충돌 할 때 나는 다음과 같은 오류를 받고 있어요 다른 정보가 도움이 될지 확실하지 않으므로 더 많은 정보가 필요하면 알려 주시기 바랍니다. 모든 도움을 주시면 감사하겠습니다. 시간 내 주셔서 감사합니다!
필수 매개 변수를 제공하여 SQLPackage.exe를 실행하여 동일한 내용을 확인 했습니까? 실제 오류가 발생할 수 있습니다. 오류가 Powershell이 대상 데이터베이스를 제어 할 수없는 것처럼 보입니다. 여러 가지 이유 때문일 수 있습니다. 내 경우 중 하나가 방화벽 때문일 수도 있습니다. 로컬 컴퓨터에서 SQLPackage.exe를 실행할 수 있습니다. 음 .. –
불행히도 SQL Package가 배포하려고하는 서버에 설치되지 않았으며 모든 곳에 설치하지 않아도됩니다. – Michelle