Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The difference between "Build", "Compile" and "None" Build actions in Visual Studio Database project

Although I can find (on the web) a lot of information about the PreDeploy and PostDeploy Build Action for SQL scripts in a Visual Studio 2012 Database project and I understand that None does not compile or include the script when deploying, please can any one definitively advise or direct me to an article that does definitively define the subtleties of Build and Compile?

My rough assumption is both of these will compile against the schema, but only Build will be deployed. Is this correct?

What I would like is the correct setting to validate my seeding scripts against the current schema (and cause a build error on invalid schema structure) but to NOT deploy with a database publish or show up in a schema compare session.

like image 777
Dib Avatar asked Aug 11 '16 13:08

Dib


1 Answers

In a database project, "Build" is used for sql files and "Compile" is used for C# or VB (i.e. SQL CLR) files. When building a database project, the output is a dacpac file containing the processed "Build" sql files and a .NET assembly (dll) file containing the processed "Compile" C# or VB files.

Files marked as "None" are simply ignored.

like image 174
Steven Green Avatar answered Nov 01 '22 05:11

Steven Green