I have an web application "WebApplication2" (Azure API) with a web job "WebJob1". I want to package the application along with the web job to a zip file in order to deploy the package to the cloud. When I do it via visual studio (Publish -> web deploy package) it works like a charm. But when I'm trying to do it via MSBuild (for automation purposes) I'm getting this error: The command:
C:\Program Files (x86)\MSBuild\14.0\Bin>MSBuild.exe "C:\Users\levs\Documents\Visual Studio 2015\Projects\WebApplication2\WebApplication2\WebApplication2.csproj" /p:OutputPath="C:\Users\levs\Documents\webPublish\MSBuildOutputPath" /p:DeployOnBuild=true /p:PackageLocation=C:\Users\levs\Documents\webPublish\test.zip /verbosity:m
The output:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(2606,5): error : Copying file C:\Users\levs\Documents\webPublish\MSBuildOutputPath**\*.* to obj\Debug\Package \PackageTmp\app_data\jobs\continuous\WebJob1\*.* failed. Illegal characters in path. [C:\Users\levs\Documents\Visual Studio 2015\Projects\WebApplication2\WebApplication2\WebApplication2.csproj]
Do you have any idea what I'm doing wrong?
BTW, the compilation of each project (the application and the webjob) separately with MSBuild works.
MSBuild version : Microsoft (R) Build Engine version 14.0.25420.1