13
votes

I'm attempting to do a command line package deploy for our Windows Store Application.

My command line instructions are:

msbuild /m  /p:Configuration=Debug /p:Platform=x86 /target:Build

I'm using VS2013 Professional with Windows 8.1

I get the following error:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets(1224,9): error APPX0002: Task 'GenerateAppxPackageRecipe' failed. Value cannot be null.\r [C:\Path\Project.csproj]

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets(1224,9): error APPX0002: Parameter name: source\r [C:\Path\Project.csproj]

How should I resolve this?

4
Scott - the build server where you are running the MSBUILD, is it a windows 8 machine?Isaiah4110
Does it work fine when built from VS itsself? Did you try removing the /m switch (sometimes msbuild gets confused when executing build in parallel)Isantipov
@Isaiah4110 The build server is a Windows 8.1 machineScott Ferguson
@Isantipov Yes, the VS Build works fine. It's only when we try to automate the process by using MSBuild from the command line that we get this error.Scott Ferguson
Did you try removing the /m switch?Isantipov

4 Answers

8
votes

This error was resolved by using the correct version of msbuild.exe On a clean build server with VS2013 installed, there are (at least) two copies of msbuild.exe installed. In our case the install locations were:

C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild.exe

and

C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe

The one in the .Net Framework folder was the one that gave us the errors. Using the version installed in the Program Files folder resolved the issue.

1
votes

It's impossible to help you without having the code which can reproduce the error. I suspect some property does not resolve correctly when building outside VS(eg VisualStudioVersion) and needs to be passed from command line. VS also uses msbuild to build your projects, so comparing build logs from VS and CMD should help you track down the problem.

I suggest, that you set visual studio's build output verbosity to diagnostic, clean solution, than build and capture the build log. Then clean solution and build from command line with verbosity set to diagnostic and /fl switch(log to file, because diagnostic build log is way too long to analyse in console window).

Compare command-line output to VS output. Look for the differences. With diagnostic level of verbosity, chances are, you'll find out what's missing (I had similar issues with database projects failing to build from cmd due to VisualStudioVersion variable not being resolved correctly, so I passed it from command line).

NB: diagnostic log is very verbose which makes analysis hard: I'd start from detailed verbosity level.

1
votes

I have deleted all files/folders from "project"/bin folder, cleaned the solution and rebuild with success !

0
votes

For those facing the issue on hybrid app (corodova in my case), delete the build folder manually and re-build from VS. Standard clean solution didn't do the job.