Lahib Lahib - 2 months ago 14
ASP.NET (C#) Question

Prevent MVCBuildViews from deleting MSdeploy Package

I am trying to build and deploy my MVC project in VSO. I have only two steps in my Build definition and you can se them below:
enter image description here

And here are my MSBuild Arguments:

/p:DeployOnBuild=true /p:PublishProfile=Project.TEST.pubxml /p:DesktopBuildPackageLocation="" /p:WebPublishPipelineProjectName=Project.TEST /p:AutoParameterizationWebConfigConnectionStrings=False

My issue here is that when every i try to build this definition i get an empty publish zip file. I found out it is because of i have set
to be true in my .csproj file. If the
is set to true then the project will build the views from this target:

<Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />

I have tried to set the
to another location but this solveds nothing because the compiler deletes the package folder in both locations.

I can't seem to figure out what to do. is there a way to disable
because this is what seems to delete the package folder before building the views.


Try adding the following attribute to your target:


I think you just need to compile the views sooner in the build process (before the files are pulled for packaging). Not sure exactly which Target you should run before but this one looks right to me.