locked
Getting a TFS build agent to package a Windows Store application

    Question

  • I'm trying to get the Build Agent from TFS Express 2012 to build and package a Windows 8 application on a gated checkin trigger. I have only one issue left for which, so far, google have definitely not been my friend.

    I have a multi-targeted solution with WinPhone8, Win8 and WPF projects as well as one Modeling project which validates the various application layers there is in the solution. The build configuration will build all of them in Debug|AnyCPU and Release|AnyCPU. So far, with only empty basic projects I can get my builds to succeed with two warnings.

    The first one is caused by the Modeling project which seems to have an issue with Windows Phone projects (can't find types in System.Windows.dll) but this is not the subject of this topic (see this topic for more info on that one). Where I need help is with the second warning:

    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\AppxPackage\Microsoft.AppXPackage.Targets (807): File 'VisualStudioEdition' is not found or is not an executable file.

    It occurs during the packaging phase of the Win8 projects. I have no problem packaging the app manually on my workstation or on the build server. This error is triggered during a call to GenerateAppxManifest where the last parameter "ManifestMetadata" contains one entry that reference the variable $(VisualStudioEdition) which seems to be undefined.

    Does anyone ever seen this before and have an idea of how to fix this?

    Friday, April 19, 2013 1:58 AM

All replies

  • I'm not sure about the error. Is the build agent installed on a windows 8 machine. Is visual studio 2012 installed on the same machine? To my knowledge, these are prerequisites to build win8 store apps

    Ahmed is an independent consultant in Ottawa, Canada specialized in .NET, Biztalk, WCF, WPF, TFS and other Microsoft technologies.

    Blog: http://lajak.wordpress.com

    Twitter: ahmedalasaad

    Friday, April 19, 2013 2:12 AM
  • Yes, the Build Agent is running on Windows 8 pro with Visual Studio 2012 update 2 ultimate and the Windows Phone SDK 8.0.

    The strangest thing with this error is there is a variable named $(VisualStudioVersion) in the metadatas as well and that one doesn't trigger any errors.

    Friday, April 19, 2013 2:52 AM
  • Can you build the solution using Visual Studio on the build server?

    In Visual Studio, can you check if the build configuration is AnyCPU or Mixed Plateforms?


    Ahmed is an independent consultant in Ottawa, Canada specialized in .NET, Biztalk, WCF, WPF, TFS and other Microsoft technologies.

    Blog: http://lajak.wordpress.com

    Twitter: ahmedalasaad

    Friday, April 19, 2013 2:57 AM
  • The solution builds fine on the agent's machine. I can also package the app through Visual Studio without any warning. There is no Mixed Platforms configuration in this solution.
    Friday, April 19, 2013 3:16 AM
  • I'm seeing exactly the same warning using TeamCity to run an automated build. So the problem is apparently not unique to TFS.

    My build server is running Windows Server 2012, and I have Visual Studio 2012 with Update 3 installed. My project targets just Windows 8, so this is a simpler configuration than the original poster's.

    If I log in with the same credentials as the build agent, open the solution in Visual Studio, and rebuild, I get no errors or warnings. If I run a command line in the same login, and run this:

    msbuild /ds /fl /t:Rebuild MySolution.sln
    

    I then get the warnings.

    If I run the same command line on my desktop (Windows 8, Visual Studio 2012 update 3), I get the same warning. (The project builds fine from within Visual Studio.)

    So this looks more like an issue that occurs when building with msbuild, than having anything to do with using a build server.

    It would seem that you can fix this simply by providing the build with the relevant property - Visual Studio sets it for you when you build within the IDE, but if you're building from the command line, you need to pass this as an argument, because if you have multiple versions of Visual Studio installer, the command line build tools have no way of knowing which one you were intending to specify. I describe how I fixed this for my build here: http://www.interact-sw.co.uk/iangblog/2013/07/29/fix-appx2102

    Monday, July 29, 2013 9:04 AM