Build macros in VS
Posted: Fri Aug 26, 2022 4:23 am
Hi All,
I am having a problem with defining some build macros for an X# project in VS2022, in particular where I want the output to go. When I select the Properties of the project and go to the Build tab, I see the snippet in attachment P1. Now I don't know what an Intermediate Output Path means or is, and I don't know what the macro names shown here are. They do not appear in the editor/browser you get when you click the three dots button at the right. So I change things to be what I want as shown in attachment P2. I build and I get, in the output window:
Build started...
------ Build started: Project: 1 bDefines, Configuration: Release Any CPU ------
1 bDefines -> C:UsersXVJBONNEsourcereposLabProRelease1 bDefines.dll
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
It has generated the output exactly where I wanted. I should be able to do this with two macros like this
$(SolutionDir)$(ConfigurationName)
but that does not seem to work. It puts the output in the folder one level higher for some reason.
I close the solution, open it again and go to the same Properties/Build for the project again and what I see is back to P1 again.
If I look at the project file in an external editor, it has an entry like this:
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" Label="Configuration">
<PlatformTarget>x86</PlatformTarget>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<EmitDebugInformation>false</EmitDebugInformation>
<DebugType>pdbonly</DebugType>
<OutputPath>$(SolutionDir)Release</OutputPath>
and the OutputPath is just what I want, but is not what I see in VS.
What is happening here?
Best Regards,
John Bonnett
I am having a problem with defining some build macros for an X# project in VS2022, in particular where I want the output to go. When I select the Properties of the project and go to the Build tab, I see the snippet in attachment P1. Now I don't know what an Intermediate Output Path means or is, and I don't know what the macro names shown here are. They do not appear in the editor/browser you get when you click the three dots button at the right. So I change things to be what I want as shown in attachment P2. I build and I get, in the output window:
Build started...
------ Build started: Project: 1 bDefines, Configuration: Release Any CPU ------
1 bDefines -> C:UsersXVJBONNEsourcereposLabProRelease1 bDefines.dll
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
It has generated the output exactly where I wanted. I should be able to do this with two macros like this
$(SolutionDir)$(ConfigurationName)
but that does not seem to work. It puts the output in the folder one level higher for some reason.
I close the solution, open it again and go to the same Properties/Build for the project again and what I see is back to P1 again.
If I look at the project file in an external editor, it has an entry like this:
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" Label="Configuration">
<PlatformTarget>x86</PlatformTarget>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<EmitDebugInformation>false</EmitDebugInformation>
<DebugType>pdbonly</DebugType>
<OutputPath>$(SolutionDir)Release</OutputPath>
and the OutputPath is just what I want, but is not what I see in VS.
What is happening here?
Best Regards,
John Bonnett