Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Incremental build with MsBuild #1471
We have recently updated our product codebase to use Paket instead of Nuget for managing our package dependencies.
Our build script builds all our csproj in a single MsBuild task. It is used as an incremental build, meaning that for most of the situation we do not clean anything before building. This was working well with NuGet. But with Paket, csproj may not be rebuilt while they shall.
It happens when someone updates an existing library package to a new version, without modifying anything in a given project using this lib. Paket updates the paket.lock file and does not modify the csproj using the library, because the unzipped path does not change.
Visual Studio handles this case well, it understands that the referenced assembly did get an update and rebuilds the csproj.
I have created a small project here to repro the problem with the library Autofac:
It seems to me there are two different situations where MsBuild fails to detect changed dependencies:
A) Active: I make the change to paket.lock myself (paket.exe install, or via add, remove, update)
With the latest version, in case A) incremental builds do indeed detect that a rebuild is required, so the fix does work. Thanks!
Case B) is a bit more involved and I don't think touching project files on restore should be the default behavior, but it might be optional (e.g. something along the lines of
This change causes a bit of an issue with our team. Our default usage for our SCM is to check out files as read-only files. This works great with paket since most of the time, the project files do not need to change. We only check out the files when we have a real change (paket or otherwise).
We do run "paket update" fairly frequently but most of the packages that we use are fixed at a version. Would it be possible to implement a change such that project files are only touched when a project that they referenced has been updated? (I understand that this could be a quite a bit of work to do.) Probably better for us would be to have the default behavior not do this but be possible with a flag (like cdrnet suggested).
We do use MSBuild on our project and have started using incremental build too. I think this would be a good feature to have for our team.
Short version: +1 to cdrnet's Case B suggestion (optional flag - default behavior does not touch project files)
FYI I have opened another issue in MsBuild:
@jschroed cdrnet and I are working in the same team. We are interested in implementing cdrnet's proposal that would touch csproj files for projects impacted by an updated library. This behavior would be activated by an optional parameter. Would that work for your case?
@forki let us know if you are OK with this plan.
referenced this issue
Feb 16, 2016
Yes every help would be appreciated. But I'm not near a pc for 2 weeks.