'Multi target Library in a UWP project

I have a few multi-target libraries targeting net461 and netstandard2.0. I am using those libs in a framework project and a UWP one. When I build on the build server, one of the library is cleaned (everything is deleted) before the UWP app is built. This library is only used in the UWP project and pulls on the other libraries.

Since everything worked fine on Visual Studio and started build using the command line. I found out that adding the -m options (parallel build) breaks the build...

Works msbuild Solution.sln /t:Rebuild /p:Configuration=Release;Platform=x64

Doesn't work msbuild Solution.sln -m /t:Rebuild /p:Configuration=Release;Platform=x64

I found a workaround, I can split the multi target project into 2 projects, one targeting net461 and on targeting netstand2.0 and linking all the files and this doesn't have the same issue.

I would rather keep things clean and have a single multi target library and also wrap my head around multi targeting and all the implication it has on the build.

edit: Build instead of Rebuild did the trick as well but I still don't understand why the assembly is cleaned and not rebuilt



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source