You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 11, 2020. It is now read-only.
I posted this on SO at first but haven't had any responses. Reposting here in the hope that somebody can shed some light on what is going on.
I have a gulp publish task which prepares assets for the production server during the publishing process. On project.json this was working successfully:
Whilst the npm install and gulp publish commands are executed, it seems like they run too late to have the assets they produce get included in the actual publish process.
If I freshly clone the repository and publish twice in a row the second one is successful, as the assets were generated from the first publish and therefore included in the second publish.
My first thought was to jump earlier in the publish process by setting BeforeTargets="Build" but not only did this also not work, but even if it had we'd be running these commands on every single build, even during development. It's as if the publish process takes a snapshot of the file-system when beginning and does not check for files added to the file-system anywhere during the publish process. For this project, we need to be able to build from a freshly cloned repository as that's what happens on the build server (git clone -> dotnet restore -> dotnet publish -c Release -o PublishOutput).
What does work is setting BeforeTargets="Restore". This generates everything perfectly on the build server, presumably as the assets generate by gulp publish existing within the file-system before the dotnet publish command. Of course, we don't want to actually generate the assets on every single dotnet restore!
Is there a way to hook into a target that is earlier than "PrepareForPublish", or does anybody even have a list of MSBuild Targets that you can latch onto? The documentation helpfully points out that MSBuild "supports many ready-made targets" with no list.
The text was updated successfully, but these errors were encountered:
I posted this on SO at first but haven't had any responses. Reposting here in the hope that somebody can shed some light on what is going on.
I have a
gulp publish
task which prepares assets for the production server during the publishing process. Onproject.json
this was working successfully:Migrating via VS2017 to MSBuild with a
csproj
gives what I expected to be equivalent as:Whilst the
npm install
andgulp publish
commands are executed, it seems like they run too late to have the assets they produce get included in the actual publish process.If I freshly clone the repository and publish twice in a row the second one is successful, as the assets were generated from the first publish and therefore included in the second publish.
My first thought was to jump earlier in the publish process by setting
BeforeTargets="Build"
but not only did this also not work, but even if it had we'd be running these commands on every single build, even during development. It's as if the publish process takes a snapshot of the file-system when beginning and does not check for files added to the file-system anywhere during the publish process. For this project, we need to be able to build from a freshly cloned repository as that's what happens on the build server (git clone
->dotnet restore
->dotnet publish -c Release -o PublishOutput
).What does work is setting
BeforeTargets="Restore"
. This generates everything perfectly on the build server, presumably as the assets generate bygulp publish
existing within the file-system before thedotnet publish
command. Of course, we don't want to actually generate the assets on every singledotnet restore
!Is there a way to hook into a target that is earlier than "PrepareForPublish", or does anybody even have a list of MSBuild Targets that you can latch onto? The documentation helpfully points out that MSBuild "supports many ready-made targets" with no list.
The text was updated successfully, but these errors were encountered: