locked
Automated Deployment Failing RRS feed

  • Question

  • Setting up an automated deployment process using CruiseControl and it should be deploying a local copy of the database. We are receiving the following error, however, running batch files manually deploys the database correctly.

    The automated build process runs under a different user, but that account has been given administrator privileges. Administrators have db_owner permissions on the database.

    C:\Program Files\MSBuild\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets (120,5):

    errorMSB4018: The "SqlDeployTask" task failed unexpectedly. System.NullReferenceException: Object reference not set to an instance of an object.
    at Microsoft.Data.Schema.Common.ConnectionStringPersistence.ExtractPassword(String partialConnection, String dbProvider)
    at Microsoft.Data.Schema.Common.ConnectionStringPersistence.RetrieveFullConnection(String partialConnection, String provider, Boolean presentUI, String password)
    at Microsoft.Data.Schema.Sql.Build.SqlDeployment.ConfigureConnectionString(String connectionString, String databaseName)
    at Microsoft.Data.Schema.Sql.Build.SqlDeployment.OnBuildConnectionString(String partialConnectionString, String databaseName)
    at Microsoft.Data.Schema.Build.Deployment.FinishInitialize(String targetConnectionString) at Microsoft.Data.Schema.Build.Deployment.Initialize(FileInfo sourceDbSchemaFile, ErrorManager errors, String targetConnectionString)
    at Microsoft.Data.Schema.Build.DeploymentConstructor.ConstructServiceImplementation()
    at Microsoft.Data.Schema.Extensibility.ServiceConstructor`1.ConstructService() at Microsoft.Data.Schema.Tasks.DBDeployTask.Execute()
    at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)

    Friday, May 29, 2009 2:13 PM

Answers

  • Yes, I did try it manually on that account now and instantly got that error message. I also figured out how to fix the issue. Not sure why it fixed it, but after getting that error message I opened Visual Studio for the first time on that account. I ran the same code again and it worked, so for some reason Visual Studio has to be configured for that account before the deployment can be done.

    I hope that helps someone else who runs into this issue.

    Brendan
    • Marked as answer by Brendoneus Monday, June 1, 2009 5:34 PM
    Monday, June 1, 2009 5:34 PM

All replies

  • Did you try manually with the same credentials that the automation would use?
    CHELVY SUN, VSTSDB, MS
    Friday, May 29, 2009 5:29 PM
  • Yes, I did try it manually on that account now and instantly got that error message. I also figured out how to fix the issue. Not sure why it fixed it, but after getting that error message I opened Visual Studio for the first time on that account. I ran the same code again and it worked, so for some reason Visual Studio has to be configured for that account before the deployment can be done.

    I hope that helps someone else who runs into this issue.

    Brendan
    • Marked as answer by Brendoneus Monday, June 1, 2009 5:34 PM
    Monday, June 1, 2009 5:34 PM
  • Thanks so much for the tip.  A life saver!

    -Krip
    Tuesday, February 23, 2010 3:56 PM