How to build Windows Store 8.1 app without Visual Studio?

Nikola Anusev picture Nikola Anusev · Jan 10, 2014 · Viewed 7.5k times · Source

I need this for the build server - I'd like to avoid installing full Visual Studio there.

I use the newest v12 MSBuild to build the solution with the app. Installing .NET Framework 4.5.1 and Windows 8.1 SDK got me through several compilation errors. With all that installed, right now, I get this:

error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v12.0\Microsoft.Windows.UI.Xaml.CSharp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

The targets file is present on my development machine with Visual Studio 2013 installed, so I guess it got there with VS 2013. When I tried to paste the whole folder to the build machine (I know, a stupid thing to do), I got the following compilation warnings and errors:

warning MSB3644: The reference assemblies for framework ".NETCore,Version=v4.5.1" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed.

XamlCompiler error WMC1006: Cannot resolve Assembly or Windows Metadata file 'System.Runtime.dll'

Xaml Internal Error error WMC9999: Type universe cannot resolve assembly: System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.

Obviously, copying and pasting stuff around is not a way to go. Is there some proper approach to achieve what I want?

EDIT: The build machine has Windows Server 2012 installed, not Windows 8.1. Could that be a problem?

EDIT 2: After comparing outputs of msbuilds executed both on development machine and build server, I've noticed that the folder C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5.1 is missing from the build machine (there is only 4.5 folder). After pasting it, I got the following error:

CompileXaml error WMC9998: XBF generation failure due to missing Windows 8.1 Support, Set property <DisableXbfGeneration>true</DisableXbfGeneration> in your Project file and try again.

There is still something missing from the Windows 8.1 toolchain...

Answer

Alexandru Puiu picture Alexandru Puiu · Jan 15, 2014

Since it's a windows store app, and Windows Server 2012 doesn't have an app store, I'd say the libraries needed in order to compile the app are just missing from the OS itself. I suggest running tracer on a windows 8.1 box to see what files are accessed during compilation, and copy them to the server. I'm not certain that this will work, but it's the likeliest scenario I can think of. You can use something like Process Monitor for this See what files/registry keys are being accessed by application in Windows Alternatively, you might want to monitor the temporary build folder in .net to see what assemblies get copied locally during the build.

EDIT: Microsoft doesn't officially support this http://msdn.microsoft.com/en-us/library/windows/apps/br211384.aspx