I have a C# project X that references a C# project Y that references a C# project Z. So the dependency chain looks like this: X => Y => Z. There is no direct/explicit dependency X => Z. When I build a package for publication using msbuild command
msbuild DesignService.csproj /m /p:Configuration="Debug" /p:Platform="AnyCPU" /verbosity:quiet /t:Package /p:PackageLocation=X.zip /p:PackageAsSingleFile=True
I get a zip file that has DLLs for X and Y, but not Z. Then when the package is published (to an Azure App Service) I get runtime errors when a call is made to code in Z, saying the DLL can not be found. If I add Z as a direct/explicit reference in X, it works just fine. But I don't think I should have to do this.
How can I get DLLs for Z in my publish package from msbuild without adding an explicit reference in X?