7

When I have an SQL Server Database project (.sqlproj) in Visual Studio solution, I notice that that particular project always gets built every time I build the solution even though there is no change in the project files.

This is inconsistent with normal C# project (.csproj) that only gets built when there is any file that changes.

I have tried cranking up the msbuild output verbosity, and it seems to always build that project without special reason.

Is there a reason why .sqlproj is always built? Is there a way to make it build only when file changes?

Aditya Santoso
  • 1,031
  • 6
  • 19

1 Answers1

0

MSBuild has the opportunity to make Incremental Build. The main idea of that is the following:

MSBuild attempts to find a 1-to-1 mapping between the values of these attributes. If a 1-to-1 mapping exists, MSBuild compares the time stamp of every input item to the time stamp of its corresponding output item. Output files that have no 1-to-1 mapping are compared to all input files. An item is considered up-to-date if its output file is the same age or newer than its input file or files.

I don't know which targets are inside the *.sqlproj file, so you need to determine does it ever uses that technology, and if it do use - you need to examine which inputs and outputs involved, and try to clarify it by yourself, what is going on with them under the hood.

stukselbax
  • 5,855
  • 3
  • 32
  • 54