Click here to Skip to main content
15,391,067 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: dotnet publish and post-build events Pin
Pete O'Hanlon10-Jan-19 2:28
mvaPete O'Hanlon10-Jan-19 2:28 
GeneralRe: dotnet publish and post-build events Pin
MarkTJohnson10-Jan-19 3:41
professionalMarkTJohnson10-Jan-19 3:41 
GeneralRe: dotnet publish and post-build events Pin
Marc Clifton10-Jan-19 9:06
mvaMarc Clifton10-Jan-19 9:06 
GeneralRe: dotnet publish and post-build events Pin
Pete O'Hanlon10-Jan-19 10:13
mvaPete O'Hanlon10-Jan-19 10:13 
GeneralRe: dotnet publish and post-build events Pin
RickZeeland10-Jan-19 3:28
mveRickZeeland10-Jan-19 3:28 
GeneralRe: dotnet publish and post-build events Pin
Marc Clifton10-Jan-19 9:04
mvaMarc Clifton10-Jan-19 9:04 
GeneralRe: dotnet publish and post-build events Pin
RickZeeland10-Jan-19 9:35
mveRickZeeland10-Jan-19 9:35 
GeneralRe: dotnet publish and post-build events Pin
Ryan Peden10-Jan-19 9:51
professionalRyan Peden10-Jan-19 9:51 
Visual Studio sets a $(BuildingInsideVisualStudio) property to true when a build started from inside VS.

I think that using this property inside a conditional will do what you want:
XML
<Choose>
  <When Condition="$(BuildingInsideVisualStudio)==true">
    <PropertyGroup>
      <PostBuildEvent>dotnet publish "$(MSBuildProjectDirectory)"</PostBuildEvent>    
    </PropertyGroup>
  </When>
</Choose>

Since VS is invoking the dotnet CLI, the PostBuildEvent won't be triggered a second time since the second build was kicked off by the CLI executable and not VS.

Hopefully I correctly understood what you're trying to accomplish. Smile | :)
GeneralRe: dotnet publish and post-build events Pin
Marc Clifton11-Jan-19 2:03
mvaMarc Clifton11-Jan-19 2:03 
GeneralRe: dotnet publish and post-build events Pin
Super Lloyd10-Jan-19 18:57
MemberSuper Lloyd10-Jan-19 18:57 
GeneralI love my monitor.... Pin
charlieg10-Jan-19 1:39
Membercharlieg10-Jan-19 1:39 
GeneralRe: I love my monitor.... Pin
glennPattonWork310-Jan-19 1:56
professionalglennPattonWork310-Jan-19 1:56 
GeneralRe: I love my monitor.... Pin
charlieg10-Jan-19 2:05
Membercharlieg10-Jan-19 2:05 
GeneralRe: I love my monitor.... Pin
dandy7210-Jan-19 5:53
Memberdandy7210-Jan-19 5:53 
GeneralRe: I love my monitor.... Pin
Marc Clifton10-Jan-19 2:14
mvaMarc Clifton10-Jan-19 2:14 
GeneralRe: I love my monitor.... Pin
OriginalGriff10-Jan-19 2:31
mveOriginalGriff10-Jan-19 2:31 
AnswerRe: I love my monitor.... Pin
megaadam10-Jan-19 2:42
professionalmegaadam10-Jan-19 2:42 
GeneralRe: I love my monitor.... Pin
Leng Vang10-Jan-19 6:03
MemberLeng Vang10-Jan-19 6:03 
GeneralRe: I love my monitor.... Pin
mgama10-Jan-19 14:30
Membermgama10-Jan-19 14:30 
GeneralCubicle conversations... Pin
charlieg10-Jan-19 1:14
Membercharlieg10-Jan-19 1:14 
GeneralRe: Cubicle conversations... Pin
glennPattonWork310-Jan-19 1:55
professionalglennPattonWork310-Jan-19 1:55 
GeneralRe: Cubicle conversations... Pin
charlieg10-Jan-19 2:09
Membercharlieg10-Jan-19 2:09 
GeneralRe: Cubicle conversations... Pin
littleGreenDude10-Jan-19 3:08
MemberlittleGreenDude10-Jan-19 3:08 
GeneralRe: Cubicle conversations... Pin
MarkTJohnson10-Jan-19 3:47
professionalMarkTJohnson10-Jan-19 3:47 
GeneralRe: Cubicle conversations... Pin
Mycroft Holmes10-Jan-19 10:54
professionalMycroft Holmes10-Jan-19 10:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Straw Poll

Do you feel you fully understand the vision and purpose of the software project you're working on?
Sure you can be told the "what", but do you have the "why"?
  Results   169 votes