I am trying to set the <OutputPath> of my C# project to the name of the project, but when the project builds, it only resolves $(SolutionDir) and not $(ProjectName) or preferably $(TargetName).
How can I use the target name in my <OutputPath>?
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>$(SolutionDir)bin\Release\plugins\$(ProjectName)</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
I have found that you can use the defined properties that are used in the propertygroups in the complete csproj.
So I used $(AssemblyName):
<OutputPath>$(SolutionDir)bin\Release\plugins\$(AssemblyName)</OutputPath>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With