Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSBuild fails due to error APPX0002: Task 'GenerateAppxPackageRecipe' failed. Value cannot be null

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?

like image 985
Scott Ferguson Avatar asked Oct 18 '13 04:10

Scott Ferguson


3 Answers

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.

like image 110
Scott Ferguson Avatar answered Oct 31 '22 01:10

Scott Ferguson


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.

like image 34
Isantipov Avatar answered Oct 31 '22 00:10

Isantipov


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

like image 1
Artyom Avatar answered Oct 31 '22 00:10

Artyom