Die Dokumentation auf BaseOutputPath Staaten Wenn es gesetzt ist, wird MSBuild verwenden OutputPath = $ (BaseOutputPath) \ $ (Konfiguration) \ 'so in anderen Worten: Wenn Sie es in der Projektdatei nicht festlegen (manuell, es gibt keinen VS GUI-Eintrag dafür) es ist einfach nicht definiert. Seltsamerweise, wenn ich alle Dateien im Verzeichnis der MsBuild-Programmdateien durchsuche, ist nirgends ein BaseOutputPath zu finden. Vielleicht wird es nur für Projekttypen verwendet, die ich nicht installiert habe, oder es ist woanders (keine Ahnung, wo das sein würde). Mysteriös, aber ich habe jetzt keine Zeit, es herauszufinden. obwohl die Microsoft.Common.CurrentVersion.targets hat wenig Interessantes Info, und Ihre Antwort:
OutDir:
Indicates the final output location for the project or solution. When building a solution,
OutDir can be used to gather multiple project outputs in one location. In addition,
OutDir is included in AssemblySearchPaths used for resolving references.
OutputPath:
This property is usually specified in the project file and is used to initialize OutDir.
OutDir and OutputPath are distinguished for legacy reasons, and OutDir should be used if at all possible.
BaseIntermediateOutputPath:
This is the top level folder where all configuration specific intermediate output folders will be created.
Default value is obj\
IntermediateOutputPath:
This is the full intermediate Output Path, and is derived from BaseIntermediateOutputPath, if none specified
(eg. obj\debug). If this property is overridden, then setting BaseIntermediateOutputPath has no effect.
So $(OutDir)
wäre die richtige Wahl hier sein, oder $(outputPath)
würde es auch tun. Standardmäßig sind diese auf etwas wie eingestellt, so dass genau das ist, was Sie wollen.
'$ (BaseOutputPath)' ist die korrekte Syntax, aber die Dokumente sagen '* wenn * es gesetzt ist' was bedeuten könnte, dass wenn Sie es nirgends setzen, es nicht dort ist (und das mit Ihren Beobachtungen übereinstimmt). Ich nehme an, das ist ein C# -Projekt, also würde ich nach '$ (OutputPath)' gehen, das normalerweise bereits $ (Configuration) und $ (Platform) enthält. – stijn
Das ist eine Antwort! Bewege diesen Kommentar, um ihn zu beantworten, damit ich ihn richtig markieren kann. – MatthewMartin