-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong target order when using both MvcBuildViews=true
and DeployOnBuild=true
MSBuild properties?
#82
Comments
Hmm - I've not encountered this myself. You might be able to fix the ordering you are talking about with <PropertyGroup>
<PipelineCollectFilesPhaseDependsOn>
$(PipelineCollectFilesPhaseDependsOn);
MvcBuildViews;
</PipelineCollectFilesPhaseDependsOn>
</PropertyGroup> If this fixes things, then I would think that a PR to add this to the SDK would be in order. You might also try msbuild /p:Configuration=Release /p:DeployOnBuild=true /p:PrecompileBeforePublish=true /p:MvcBuildViews=false |
I realized after looking a bit further into this that we don't really need to have the So I worked around this by adding
As I understand it, For now, the only reason we've been using the standard |
You do understand correctly about the If you decide that while you are investigating the |
Probably worth it to add that to the "docs/SDK.md" and the getting started documentation. I just found this project and am loving it. But our CI/CD system would probably have hit this and it would take us a bit to wonder why compilation was taking so long. |
@EmperorArthur Happy to take PRs to the docs to clarify anything. There are a lot of 'special cases' for this, as everybody has their own CI/CD scripts and ways of doing things. |
I'm playing around with switching our deployment process from a "raw" file copy of build outputs, to a more proper "publish"-based approach, where we first publish to a folder and then copy those contents instead. One of the things I want to tap into with this change is the native XML transform step, which we currently cannot use as it only runs on publish.
However, I noticed that when I try to publish in
Release
mode, the contents of thebin/obj/Package
folder (the standard place where publish outputs are placed) is empty.I'm running the following simple commandline:
I noticed that if I executed the exact same command, but using
Debug
configuration, the files were output just fine.After analyzing the logs, I noticed that the publish results were being cleaned by the aspnet compilation target, which appears to be running after the publishing step. This of course is triggered by the
MvcBuildViews
flag, which istrue
by default only inRelease
mode.At first glance, this makes little sense to me: shouldn't aspnet compilation be happening before packaging, so that the extra compiled bits are included in the publish package?
Here is a slightly redacted version of the MSBuild logs from one of our affected projects, starting after the
CoreCompile
target:The package contents are generated in the
PackageUsingManifest
target, but right after that,CleanupForBuildMvcViews
is executed and deletes all the files it generates.I found a similar problem described here:
But in that case, the person had the
MvcBuildViews
target declared in their own project, which is not the case with this SDK, where that target (AFAIK) is part of the SDK itself.Am I missing something obvious here, or is there an issue in the SDK that should be fixed so that
MvcBuildViews
(aspnet compiler dynamic compilation) takes place before the standard publishing targets do?Is this SDK supposed to work with the
DeployOnBuild
MSBuild flag? Or should I actually be looking into a different deployment approach altogether?The text was updated successfully, but these errors were encountered: