Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build Windows Store 8.1 app without Visual Studio?

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...

like image 349
Nikola Anusev Avatar asked Jan 09 '14 23:01

Nikola Anusev


People also ask

Does Windows 8.1 have app store?

When you're connected to the Internet, Windows 8.1 clients obtain updates to Microsoft Store apps directly from the Microsoft Store app. The Microsoft Store app is visible on the Windows Start screen.

What is .NET for Windows Store apps?

NET. . NET code can be used for user interface, business logic and background processing. You can continue to use . NET on the server too, as the implementation of REST, WCF or ODATA APIs that you call from within your Windows Store Apps.

How do I install Microsoft SDKS?

You can get the Windows SDK in two ways: install it from this page by selecting the download link or by selecting “Windows 11 SDK (10.0.22621.0)” in the optional components of the Visual Studio 2022 Installer. Before you install this SDK: Review all system requirements. Exit Visual Studio prior to installation.


2 Answers

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

like image 177
Alexandru Puiu Avatar answered Sep 29 '22 05:09

Alexandru Puiu


Did you download and install Microsoft Build Tools 2013 on the build server? The v12 version of MsBuild is now released as part of Visual Studio (instead of the Microsoft.NET Framework) and you'd want to use this separate install to get the MsBuild v12 bits on your build server.

like image 28
Nicodemeus Avatar answered Sep 29 '22 07:09

Nicodemeus