Monday, 15 August 2011

sql server - DACPAC Deploy via c# fails due to missing user -


I wrote a small tool that uploads a .bak file in the local SQL instance and then from the newly created database Receives a DACPAC. Then DACCPAC has been deployed for another SQL instance, which is not on the same machine.

All these steps are done in C # through Microsoft. SQLServer.Smo and Microsoft.SqlServer.Dac however, the last step (deployed on the remote server) fails, it is saying that the process can not be created by the user. I can live with leaving that user, although I do not want to manually modify dacpac file or database. To leave the user I tried to configure the deployment process, but it does not work.

This is my code for deployment:

  var remoteService = new DacServices (targetConnection); Try {var package = DacPackage.Load (file.FullName); Var Settings = New DacDeployOptions (); Settings.IgnoreUserSettingsObjects = true; Telecommunication service Package (target, package, target, name, wrong, settings); } Hold (Exception Pre) {Console.WriteLine (ex.Message); DeleteDb (targetName, targetConnection); }  

On execution, the following error message is shown (freely translated, this error or similar on Google did not meet, so that I do not know the actual English translation)

Error SQL72014: .NET SqlClient Data Provider: Windows NT User or Group '[XYZ]' not found.

Any thoughts?

Before fixing dacPackage, I fixed the problem by removing all additional non-system users from the source database is.


No comments:

Post a Comment