msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

MsBuild incremental build does not consider referenced assembly file changes

Open FrenchMigVaz opened this issue 10 years ago • 1 comments

Given a project A.csproj references a library B.dll And library B is in a static relative path "....\packages\A\lib\net45\B.dll" When library B.dll is updated to a new version without modifying its relative path When project A.csproj is built using a MsBuild task with ToolsVersion=4.0, 12.0 or 14.0 Then project A is not rebuilt leading to a potential runtime failure of not finding dependency B

I have created a small project here to repro the problem with the library Autofac: https://github.com/Vilmir/IncrementalBuildCheckWithPaket

Repro steps:

  • Open Developper Command Prompt for VS 2015
  • msbuild.exe build.proj
  • Run bin/Debug/IncrementalBuildCheck.exe it works
  • ".paket/paket.exe" update nuget Autofac version 3.5.2
  • msbuild.exe build.proj
  • Run bin/Debug/IncrementalBuildCheck.exe, you shall see an exception:
System.IO.FileLoadException: Could not load file or assembly 'Autofac, Version=3.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da' or
 one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131
040)
File name: 'Autofac, Version=3.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da'
   at IncrementalBuildCheck.Program.TestLibrary()
   at IncrementalBuildCheck.Program.Main(String[] args) in C:\Users\11mvazquez\Desktop\IncrementalBuildCheckWithPaket\Program.cs:line 12

FrenchMigVaz avatar Feb 15 '16 10:02 FrenchMigVaz

Issue is also discussed in Paket. We would like to implement a workaround there: https://github.com/fsprojects/Paket/issues/1471

FrenchMigVaz avatar Feb 16 '16 08:02 FrenchMigVaz