I've the same question of How to have different Project Dependencies for each Project Configuration?, but the provided solution is very outdated and I'm not able to reproduce it on VS2017.
I'm receiving this error, and I don't know how to exclude the project from the linking.
Error CS0006 Metadata file 'path\to\my\excluded\library.dll' could not be found