(1 item) |
|
(1 item) |
|
(5 items) |
|
(1 item) |
|
(1 item) |
|
(2 items) |
|
(2 items) |
|
(4 items) |
|
(1 item) |
|
(6 items) |
|
(2 items) |
|
(4 items) |
|
(1 item) |
|
(4 items) |
|
(2 items) |
|
(1 item) |
|
(1 item) |
|
(1 item) |
|
(1 item) |
|
(1 item) |
|
(1 item) |
|
(1 item) |
|
(1 item) |
|
(2 items) |
|
(2 items) |
|
(5 items) |
|
(3 items) |
|
(1 item) |
|
(1 item) |
|
(1 item) |
|
(3 items) |
|
(1 item) |
|
(1 item) |
|
(2 items) |
|
(8 items) |
|
(2 items) |
|
(7 items) |
|
(2 items) |
|
(2 items) |
|
(1 item) |
|
(2 items) |
|
(1 item) |
|
(2 items) |
|
(4 items) |
|
(1 item) |
|
(5 items) |
|
(1 item) |
|
(3 items) |
|
(2 items) |
|
(2 items) |
|
(8 items) |
|
(7 items) |
|
(3 items) |
|
(7 items) |
|
(6 items) |
|
(1 item) |
|
(2 items) |
|
(5 items) |
|
(5 items) |
|
(7 items) |
|
(3 items) |
|
(7 items) |
|
(16 items) |
|
(10 items) |
|
(27 items) |
|
(15 items) |
|
(15 items) |
|
(13 items) |
|
(16 items) |
|
(15 items) |
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.)
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.
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.