Inherit Post-Build-Event in Visual Studio?

I have a solution in Visual Studio in which I have a common property table containing the Post-Build Event ( bar) command that needs to be executed for each project.

Foo.props> General Properties> Build Events> Post Build Event> Command Line = Bar

How can I specify additional post-build events for a specific project? The usual "Inherit from parent or project defaults" is missing, and I do not need to manually add barto each individual project, as this makes maintenance difficult.

+5
source share
3 answers

post, . ; ?


: :

<!-- CommandX.props -->
<PropertyGroup>
  <CommandX>bar</CommandX>
</PropertyGroup>

$(CommandX) post-build . $(CommandX) , .

, Import CommandX, $(CommandX) :

<!-- Some-Other-Property-Sheet.props -->
<ImportGroup Label="PropertySheets">
  <Import Project="CommandX.props" />
</ImportGroup>

, MSBuild; , Exec .

+2

. , V++ .

, /% (Command). .

PropertySheet1.props

copy some.dll $(OutputPath)
%(Command)

PropertySheet2.props

copy other.dll $(OutputPath)
%(Command)

.

+16

, , .

: Visual Studio 2013, Pre-Build and Post-Build "Inherit from parent or project defaults", .

(Tested with Visual Studio 2013 and 2017 Professional)

0
source

All Articles