{"action":"created","issue":{"url":"https://api.github.com/repos/fsprojects/Paket/issues/1471","repository_url":"https://api.github.com/repos/fsprojects/Paket","labels_url":"https://api.github.com/repos/fsprojects/Paket/issues/1471/labels{/name}","comments_url":"https://api.github.com/repos/fsprojects/Paket/issues/1471/comments","events_url":"https://api.github.com/repos/fsprojects/Paket/issues/1471/events","html_url":"https://github.com/fsprojects/Paket/issues/1471","id":133261293,"number":1471,"title":"Incremental build with MsBuild","user":{"login":"Vilmir","id":8736108,"avatar_url":"https://avatars.githubusercontent.com/u/8736108?v=3","gravatar_id":"","url":"https://api.github.com/users/Vilmir","html_url":"https://github.com/Vilmir","followers_url":"https://api.github.com/users/Vilmir/followers","following_url":"https://api.github.com/users/Vilmir/following{/other_user}","gists_url":"https://api.github.com/users/Vilmir/gists{/gist_id}","starred_url":"https://api.github.com/users/Vilmir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vilmir/subscriptions","organizations_url":"https://api.github.com/users/Vilmir/orgs","repos_url":"https://api.github.com/users/Vilmir/repos","events_url":"https://api.github.com/users/Vilmir/events{/privacy}","received_events_url":"https://api.github.com/users/Vilmir/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-02-12T14:57:23Z","updated_at":"2016-02-16T03:40:13Z","closed_at":"2016-02-15T10:54:14Z","body":"We have recently updated our product codebase to use Paket instead of Nuget for managing our package dependencies.\r\nOur developers are quite pleased by this move, but we discovered a cumbersome behavior of MsBuild in incremental builds.\r\n\r\nOur 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.\r\n\r\nIt 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.\r\n\r\nVisual Studio handles this case well, it understands that the referenced assembly did get an update and rebuilds the csproj.\r\nMsBuild does not handle this case, and does not rebuild the csproj. It seems that MsBuild does not consider referenced assemblies as inputs to decide whether or not to rebuild.\r\nThe assembly produced by the csproj still uses the old, now depreciated library assembly. If this assembly is called, it fails with a dependency not found error.\r\n\r\nI have created a small project here to repro the problem with the library Autofac:\r\nhttps://github.com/Vilmir/IncrementalBuildCheckWithPaket\r\n\r\nRepro steps:\r\n* Open Developper Command Prompt for VS 2015\r\n* msbuild.exe build.proj\r\n* Run bin/Debug/IncrementalBuildCheck.exe it works\r\n* \".paket/paket.exe\" update nuget Autofac version 3.5.2\r\n* msbuild.exe build.proj\r\n* Run bin/Debug/IncrementalBuildCheck.exe, you shall see an exception:\r\n```\r\nSystem.IO.FileLoadException: Could not load file or assembly 'Autofac, Version=3.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da' or\r\n one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131\r\n040)\r\nFile name: 'Autofac, Version=3.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da'\r\n   at IncrementalBuildCheck.Program.TestLibrary()\r\n   at IncrementalBuildCheck.Program.Main(String[] args) in C:\\Users\\11mvazquez\\Desktop\\IncrementalBuildCheckWithPaket\\Program.cs:line 12\r\n```"},"comment":{"url":"https://api.github.com/repos/fsprojects/Paket/issues/comments/184501300","html_url":"https://github.com/fsprojects/Paket/issues/1471#issuecomment-184501300","issue_url":"https://api.github.com/repos/fsprojects/Paket/issues/1471","id":184501300,"user":{"login":"jschroed","id":6068593,"avatar_url":"https://avatars.githubusercontent.com/u/6068593?v=3","gravatar_id":"","url":"https://api.github.com/users/jschroed","html_url":"https://github.com/jschroed","followers_url":"https://api.github.com/users/jschroed/followers","following_url":"https://api.github.com/users/jschroed/following{/other_user}","gists_url":"https://api.github.com/users/jschroed/gists{/gist_id}","starred_url":"https://api.github.com/users/jschroed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jschroed/subscriptions","organizations_url":"https://api.github.com/users/jschroed/orgs","repos_url":"https://api.github.com/users/jschroed/repos","events_url":"https://api.github.com/users/jschroed/events{/privacy}","received_events_url":"https://api.github.com/users/jschroed/received_events","type":"User","site_admin":false},"created_at":"2016-02-16T03:40:13Z","updated_at":"2016-02-16T03:40:13Z","body":"Hi guys,\r\n\r\nThis 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).\r\n\r\nWe 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).\r\n\r\nWe 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.\r\n\r\nShort version: +1 to cdrnet's Case B suggestion (optional flag - default behavior does not touch project files)"}}