IanG on Tap

Ian Griffiths in Weblog Form (RSS 2.0)

Blog Navigation

April (2018)

(1 item)

August (2014)

(1 item)

July (2014)

(5 items)

April (2014)

(1 item)

March (2014)

(1 item)

January (2014)

(2 items)

November (2013)

(2 items)

July (2013)

(4 items)

April (2013)

(1 item)

February (2013)

(6 items)

September (2011)

(2 items)

November (2010)

(4 items)

September (2010)

(1 item)

August (2010)

(4 items)

July (2010)

(2 items)

September (2009)

(1 item)

June (2009)

(1 item)

April (2009)

(1 item)

November (2008)

(1 item)

October (2008)

(1 item)

September (2008)

(1 item)

July (2008)

(1 item)

June (2008)

(1 item)

May (2008)

(2 items)

April (2008)

(2 items)

March (2008)

(5 items)

January (2008)

(3 items)

December (2007)

(1 item)

November (2007)

(1 item)

October (2007)

(1 item)

September (2007)

(3 items)

August (2007)

(1 item)

July (2007)

(1 item)

June (2007)

(2 items)

May (2007)

(8 items)

April (2007)

(2 items)

March (2007)

(7 items)

February (2007)

(2 items)

January (2007)

(2 items)

November (2006)

(1 item)

October (2006)

(2 items)

September (2006)

(1 item)

June (2006)

(2 items)

May (2006)

(4 items)

April (2006)

(1 item)

March (2006)

(5 items)

January (2006)

(1 item)

December (2005)

(3 items)

November (2005)

(2 items)

October (2005)

(2 items)

September (2005)

(8 items)

August (2005)

(7 items)

June (2005)

(3 items)

May (2005)

(7 items)

April (2005)

(6 items)

March (2005)

(1 item)

February (2005)

(2 items)

January (2005)

(5 items)

December (2004)

(5 items)

November (2004)

(7 items)

October (2004)

(3 items)

September (2004)

(7 items)

August (2004)

(16 items)

July (2004)

(10 items)

June (2004)

(27 items)

May (2004)

(15 items)

April (2004)

(15 items)

March (2004)

(13 items)

February (2004)

(16 items)

January (2004)

(15 items)

Blog Home

RSS 2.0

Writing

Programming C# 5.0

Programming WPF

Other Sites

Interact Software

Fixing APPX2102 Build Warnings

Monday 29 July, 2013, 08:57 AM

I’m working on a Windows Store application, and I’ve set up an automated build process using TeamCity. Although builds were completing successfully (in the sense that I was able to install and run the results) I was seeing these warnings in my build log:

[GenerateAppxManifest] C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\AppxPackage\Microsoft.AppXPackage.Targets(808, 9): warning APPX2101: File 'VisualStudioEdition' is not found or is not an executable file.

This happened inside the _GenerateCurrentProjectAppxManifest step.

It seems that this is not unique to TeamCity. As this MSDN forum post shows, you can get the same warning on a TFS build agent.

In fact, this seems to have nothing much to do with build agents per se. You can reproduce the problem simply by running the build from the command line, e.g.:

msbuild /t:Rebuild MySolution.sln

I find this reproduces the same warning on my desktop machine, which is able to build the project without warnings from within Visual Studio. (And likewise, if I log into my build server with Remote Desktop, using the same login as the build agent, I can build the project without warnings from within Visual Studio. I only see the problem either on automated builds, or if I launch MSBuild from the command line.)

The Problem

As far as I can tell, when you build from within Visual Studio, it sets the VisualStudioEdition property to the name of the edition you have installed, e.g. Microsoft Visual Studio Ultimate 2012. But when you build from the command line, this does not get set. And it would appear that even if you use TeamCity’s “Visual Studio (sln)” build runner, it also does not set this parameter. (TeamCity offers both “MSBuild” and a “Visual Studio (sln)” build runners. You typically use the latter if you’re building something that requires Visual Studio to be installed, e.g. a Windows Store app. But apparently, it doesn’t quite recreate the exact same build environment you’d get if you load the project into Visual Studio and build it from there.)

The build step for creating the application manifest seems to generate a warning if this particular property is not present. It doesn’t really seem to need it, because the build works despite the warning. But it’s unsettling, and also annoying if you like a clean build. And perhaps something subtle can go wrong when this build step doesn’t have this information.

The Fix

You can supply the build with the information it wants by setting the property in the MSBuild command line. You can do that with the /p: argument, but since I’m using TeamCity, I’ve gone down the recommended path of adding an entry under “System Properties” in the Build Parameters. I’ve added a system.VisualStudioEdition property, which I have set to the name of the edition of Visual Studio installed on my build server. This causes TeamCity’s build runner to pass that via a /p: switch when it runs MSBuild. As a result, my automated builds now run without warnings.

Copyright © 2002-2018, Interact Software Ltd. Content by Ian Griffiths. Please direct all Web site inquiries to webmaster@interact-sw.co.uk