Search code examples
c#asp.netvisual-studio-2012msbuildmsdeploy

Publish project with build in VS2012 Fails with "Skipping unpublishable project"


I am migrating current solution from VS2010 to VS2012, since web deployment projects are not supported i am trying "Publish" feature on the project.

My requirement is to run "Publish" on the project while running the build. This is a ".csproj" with publish method "File System" also on settings tab of publish i have "Precompile during Publishing" and "Merge all outputs into single assembly".

I can manually run publish by right clicking on project and selecting "Publish" and it gives desired single assembly and copies it to right location, i just need this to run on build

I have tried following to no avail

Adding single line to .csproj file

    <DeployOnBuild>true</DeployOnBuild>

tried adding following lines to .csproj

<FilesToIncludeForPublish>OnlyFilesToRunTheApp</FilesToIncludeForPublish>
<DeployOnBuild>true</DeployOnBuild>
<DeployTarget>Package</DeployTarget>
<PackageAsSingleFile>true</PackageAsSingleFile>

Command line

MSBuild C:\MyProj.csproj /p:DeployOnBuild=true /p:PublishProfile=WebDeploy /p:CreatePackageOnPublish=True /p:VisualStudioVersion=11.0

Above command results in

Build started 07/04/2014 14:01:05.
Project "C:\MyProj.csproj" on node 1 (default targets).
Build:
Running Publish
_DeploymentUnpublishable:
Skipping unpublishable project.
Done Building Project "C:\MyProj.csproj" (default targets).
Build succeeded.

Solution

  • To my surprise it turned out to be McAfee antivirus which is messing up "Publish" here, i was doing things right and it all works fine with McAfee turned off, somehow the antivirus stops the aspnet_compiler.exe to pre-compile the site and as a result the pre-compilation and subsequent merge steps(merge dlls into single assembly) fails, hope no one goes through same pain to find this out.