Visual Studio Database project target platform in publish profile

邮差的信 提交于 2019-12-05 23:26:06

Azure, MSSQL 2014, MSSQL 2016 have different limitations and requirements to Database Project.

Let's imagine: You are using FILESTREAM in MSSQL 2014 and will use in MSSQL 2016. And your FILESTREAM is described in Database Project. Now, you add Azure support in your solution and want to deploy database. But, Azure does not support FILESTREAM.

So you can't have one database project in this case. You need to select minimal supported target project:

In this case, it's Microsoft Azure SQL Databse (or V12). When you select minimal supported target platform, you can be sure that all "higher" versions will support it.

Assume, that Azure is some subset of MSSQL Server features. And Database Project validates all using features across target platform.

If you afraid that selecting Microsoft Azure SQL Databse as target platform you won't able to publish to MSSQL Server 2016 - no problem, it will work.

If you need to use different connection strings or publish settings - create different publish profiles.

You can use msbuild and rebuild to generate dacpac. We can change the target platform in the project using powershell to make automated way.

msbuild SlnFolders.sln /t:NotInSolutionfolder:Rebuild;NewFolder\InSolutionFolder:Clean

From there we can do dacpac deployment with publish profile.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!