Azure Project build package working from VS, failing from command line with error MSB4096
I found this link: Visual Studio 2010 Beta 2 myTODO Error message it works for me. The valuable information from that link:
It seems like maybe Azure does not like it if you specify anything besides an Azure Role project as a dependency on the service project. I made it so MyWebRole.csproj was dependent on xxx.csproj, instead of MyService.ccproj being dependent on xxx.csproj, and it worked.
This post solved my problem:http://michaelcollier.wordpress.com/2013/01/14/multiple-sites-in-a-web-role/
A must read if you have several websites on one webrole!
I stumbled upon a similar problem when building my cloud project from the command line, in particular I get this exception if the web project referenced by the VirtualDirectory
tag is marked as a build dependency for the cloud project.
To avoid this and ensure that the web project is compiled and included in the cspack
, I come up with a procedure simpler that the one cited in Swell's answer -- in particular it does not require to alter the project files but only to call two targets in a precise order:
- ensure in
Configuration Manager
that the web project will be rebuilt in the desired solution configuration (for example ensure that it is built underRelease
configuration); - ensure that the web project is not a build dependency of the cloud project;
do a rebuild of the solution, for example
MsBuild solution.sln /t:Rebuild ...
This way the web project will be recompiled.
perform a publish of the cloud project, for example
MsBuild solution.sln /t:cloudproject.ccproj:publish ...
The web project will be copied correctly to the
cspack
file.