How to define project OutputPath in a solution file? (Or how to specify custom project properties in a solution file?)

StackOverflow https://stackoverflow.com/questions/986456

  •  13-09-2019
  •  | 
  •  

Question

How can I define project OutputPath in a solution file?

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'DebugUse|AnyCPU' ">
  <DebugSymbols>true</DebugSymbols>
  <OutputPath>bin\Debug\</OutputPath> <!-- this -->
  <DefineConstants>DEBUG;TRACE</DefineConstants>
  <DebugType>full</DebugType>
  <PlatformTarget>AnyCPU</PlatformTarget>
  <ErrorReport>prompt</ErrorReport>
</PropertyGroup>

Alternatively, I think I could use a custom project property.

<OutputPath>$(SolutionOutputPath)\Debug\</OutputPath>

But I don't know how define custom project properties in a solution file. I was trying something like:

Project(...) = ...
    ProjectSection(ProjectProperties) = preProject
        OutputPath = "C:\Test\Bin"
    EndProjectSection
EndProject
Was it helpful?

Solution

I'm fairly sure this isn't possible. The solution file just references project files, so all project-specific options such as output paths and so on, must be contained within the referenced project file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top