I want to publish dac pac in single user mode to prevent unnecessary db changes while database is upgrading. For that I have used Deploy function in Microsoft.SqlServer.Dac.DacServices.
That function there is a argument DacDeployOptions options. I have set DeployDatabaseInSingleUserMode = true
in that options. Even though it is set to true I am able to do db operation while dacpac is deploying.
Is there anything I am missing? or Is there any other way to achieve this.
Help will be Appreciated!
Which version of DacFX are you using? If it's not the latest, best get the latest, because a lot of the older ones are not very good at recognizing the options you specify.
Alternatively, you could do this(It's what i've done, instead of trying to get DacFX to work properly.