Visual Studio build successful, MSBuild fails

后端 未结 7 2418
有刺的猬
有刺的猬 2021-02-19 02:08

I am trying to clean and rebuild a solution file with multiple projects from the command line using MSBUILD. For some reason my build fails (about 10% of the built projects fail

7条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-19 02:19

    I just had to deal with this issue and it turns out that msbuild likes to move built binaries into the binaries\release directory and reference those instead of the projects themselves when it builds things. After building it copies the files to this directory. This explains why it works in visual studio and not msbuild (I'm currently using TFS 1010).

    In my case I had an old binary version of a dll being referenced by a project that was being built after the one that should have generated the correct file. The old one (binary) was overwriting the new one (built from source) as the solution referencing the binary one was being built later in the build.

提交回复
热议问题