Skip to content

How to run Target in backgroud before debugging #8216

Closed

Description

@Eptagone

I want to run a Node Script command in background before my debugging process.

<Target Name="DebugRunAssetsDevServer" BeforeTargets="Run" Condition=" '$(Configuration)' == 'Debug' ">
    <!-- Run the assets dev server -->
    <Message Importance="normal" Text="Starting Assets Dev Server" />
    <Exec Command="npm run dev" ContinueOnError="true" />
</Target>

The above code doesn't work when I start the project in debug mode. It works if I change to BeforeTargets="Build" but hangs waiting for the command to finish. But that command shouldn't finish because it starts my Vite Dev Server which compiles my scripts while I'm editing them.

Activity

  1. added
    needs-triage
    on Dec 5, 2022
  2. JaynieBai commented on Dec 5, 2022

    @JaynieBai
    Member

    https://learn.microsoft.com/en-us/visualstudio/msbuild/target-build-order?view=vs-2022. Seems msbuild targets can only be build in order. I think you need to build your DebugRunAssetsDevServer target seperately.

  3. locked and limited conversation to collaborators on Dec 5, 2022
  4. converted this issue into a discussion #8217 on Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions