locked
Visual Studio 2013 final version. Command line builds are failing due to: : error APPX0002: Task 'GenerateAppxPackageRecipe' failed. Value cannot be null.\r

    Question

  • I have a JavaScript project to build a modern app. Everything works in the IDE. I can build the solution and generate app packages with no issues.

    However when I try using

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe myapp.sln /p:Configuration=Release /p:Platform=x86 /t:Rebuild

    It compiles fine, but somewhere in the "_GenerateProjectPriFileCore:" step, after resources.pri is generated it throws up:

    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets(1224,9): error APPX0002: Task 'GenerateAppxPackageRecipe' failed. Value cannot be null. [myapp.jsproj]
    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets(1224,9): error APPX0002: Parameter name: source [myapp.jsproj]
    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets(1224,9): error APPX0002:  [myapp.jsproj]
    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets(1224,9): error MSB4018: The "GenerateAppxPackageRecipe" task failed unexpectedly. [myapp.jsproj]
    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets(1224,9): error MSB4018: System.ArgumentNullException: Value cannot be null. [myapp.jsproj]
    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets(1224,9): error MSB4018: Parameter name: source [myapp.jsproj]
    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets(1224,9): error MSB4018:    at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer) [myapp.jsproj]
    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets(1224,9): error MSB4018:    at Microsoft.Build.AppxPackage.DumpResourceIndexMap..ctor(ITaskItem[] indexedPayloadFiles) [myapp.jsproj]
    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets(1224,9): error MSB4018:    at Microsoft.Build.AppxPackage.ResourceIndexMap.Create(String projectDir, String makePriExtensionPath, ITaskItem[] indexedPayloadFiles) [myapp.jsproj]
    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets(1224,9): error MSB4018:    at Microsoft.Build.AppxPackage.GenerateAppxPackageRecipe.ExecuteImplementation() [myapp.jsproj]
    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets(1224,9): error MSB4018:    at Microsoft.Build.AppxPackage.AppxPackagingTaskHelper.Execute() [myapp.jsproj]
    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets(1224,9): error MSB4018:    at Microsoft.Build.AppxPackage.GenerateAppxPackageRecipe.Execute() [myapp.jsproj]
    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets(1224,9): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [myapp.jsproj]
    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\Microsoft.AppXPackage.Targets(1224,9): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() [myapp.jsproj]
    Done Building Project "myapp.jsproj" (Rebuild target(s)) -- FAILED.
    Done Building Project "myapp.sln" (Rebuild target(s)) -- FAILED.

    Build FAILED.

    NOTE:

    1. This command line was working just fine with VS 2013 PREVIEW version for the same project. The only change to the project file is to refer to the final version of the VC libs and to NEVER generate an 'app bundle'

    2. Some online resource mentioned uninstall and reinstalling VS. I tried that too.

    3. AppPackages are created just fine from the IDE.

     

     

    Tuesday, October 22, 2013 11:24 PM

Answers

  • You should change your build script to use MSBuild 12 located C:\Program Files (x86)\MSBuild\12.0\Bin.

    If you are using TFS and Team Build and haven't customized your build templates you can simply switch to the TfvcTemplate.12 or the GitTemplate.12.  If you have customized your workflow you can change the ToolPath property on the MSBuild activity to be "C:\Program Files (x86)\MSBuild\12.0\Bin".

    • Marked as answer by taklamota Thursday, October 24, 2013 9:59 PM
    Thursday, October 24, 2013 3:09 PM

All replies

  • UPDATE:

    It looks like only the Visual Studio 2013 final version has this issue. This error does not happen with Visual Studio 2013 RC.

    We had a automated build node that was on Visual Studio 2013 RC with Windows 8.1 RTM. My solution was building fine from the command line using MsBuild

    After running Windows updates on the build node and upgrading Visual Studio 2013 RC to Visual Studio 2013 final version, the above error happens for the exact same sln.

    Wednesday, October 23, 2013 12:14 AM
  • Do you have any specific repro steps to reproduce this issue? Does it happen with even a simple "Hello World" app or is it specific to your app?

    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    Wednesday, October 23, 2013 12:50 AM
    Moderator
  • Yes, to my surprise it does. All I did was:

    1. Create a new JavaScript windows store app using the "Split App" template.

    2. Removed the Any CPU and ARM configurations.

    3. Created a batch file that first runs VsDevCmd.bat from the Common7\Tools folder (to set the dev env) and ran the command below. Got the same error

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe C:\Code\testapps\TestApp\testapp.sln /p:Configuration=Release /p:Platform=x64 /t:Rebuild

    Do you want me to zip up my test project and send it to you guys somehow.

    Wednesday, October 23, 2013 8:10 PM
  • Hi,

    We've just experienced the same issue.

    We've been working on a Win 8.1 RT and WinJS 8.1 app using RC for the last couple of week and our build server has been working fine.

    We've just upgraded to VS 2013 RTM and are experiencing the same error.

    If we log onto the build box, I can open the solution in VS2013 and compile it locally (in Debug & Release mode) and everything works fine. If I execute the build via the Build Server (which compiles via MSBuild) we see the error above.

    Many Thanks,



    Howard van Rooijen co-founder | @endjin


    Thursday, October 24, 2013 2:35 PM
  • You should change your build script to use MSBuild 12 located C:\Program Files (x86)\MSBuild\12.0\Bin.

    If you are using TFS and Team Build and haven't customized your build templates you can simply switch to the TfvcTemplate.12 or the GitTemplate.12.  If you have customized your workflow you can change the ToolPath property on the MSBuild activity to be "C:\Program Files (x86)\MSBuild\12.0\Bin".

    • Marked as answer by taklamota Thursday, October 24, 2013 9:59 PM
    Thursday, October 24, 2013 3:09 PM
  • As in:

    http://msdn.microsoft.com/en-us/library/vstudio/hh162058.aspx

    Thanks for the heads up!


    Howard van Rooijen co-founder | @endjin


    Thursday, October 24, 2013 3:13 PM
  • That fixed it. Thanks!
    Thursday, October 24, 2013 9:58 PM