Building UWP app from command line - build

I need to create kind of builder for my Universal Windows App (UWP) application, that would load some configuration into it, build it and create app store package. Is there any way to build UWP app from command line, without associating it with the store and using Visual Studio at all?
There is WinAppDeployCmd, but it can be used to install builded appx package on device and I need tool like that to generate that package.
UPDATE
I've managed to build it and create app packages with command line, here is command I used:
msbuild "path to .csproj file" /p:OutDir=output_dir /p:AppxBundle=Always;AppxBundlePlatforms="x86|x64|ARM" /p:BuildAppxUploadPackageForUap=true
It's working but not as it should apparently. I can not install generated appx package on my phone (and emulator). I just get error
Failure reason: Failed to start deployment. Failure text: Install failed. Please contact your software vendor. (0x80073cf9)
I found many solutions for Windows 10 PC version, but there is only one solution I found for Windows 10 Mobile and this "solution" is to hard reset the phone, but I do not want to do that. Is there any other way?
And there is one more problem. This command doesn't work with parameter /p:Configuration=Release; and it only builds with Debug configuration, but I believe this is not related to previous error, because it doesn't work with Visual Studio either.
UPDATE
I could not find another solution, so I did the 'hard reset' of my phone and now it is working. It's sad, but I hope the reason is the Windows 10 Mobile OS is still in beta version.

Step 1 : See, you need to install .NET Framework installer from the below link. https://www.microsoft.com/en-us/download/details.aspx?id=30653
Step 2 : Go to C: drive and find where msbuild.exe is. You will find more msbuild. But mostly it will be in the location like C:\Windows\Microsoft.NET\Framework\v4.0.30319.
Step 3: Open the CMD in administrator and point to the location which is mentioned in Step 2.
Step 4 : Paste this. msbuild.exe "YourCompleteProjectPath.sln" /t:rebuild
See this for reference : https://msdn.microsoft.com/en-us/library/ms164311%28v=vs.85%29.aspx

Related

"Could not determine which "make" command to run. Check the "make" step in the build configuration." Qt creator

I installed several times the qt creator but it never cost me as much as in my current PC; First I used the installer that always had on my Pendrive (that of Qt 5.8), told me that I could not download some repositories, I downloaded version 5.9 of the same installer, with the same result. After trying to install it several times and it did not load I went to another house where I managed to install it, although I had to be very aware of many errors coming out of missing libraries (while installing Qt 5.9). After this I had to download the sp1 for my win7 OS through "windows updates" to run the Qt creator, but later, when loading, creating or running a project, I would say in console (it does not matter if it is GUI) the following : "Could not determine which" make "command to run. Check the" make "step in the build configuration." I would very much appreciate your help to anyone who wants to advise me, because I have already had many problems with my computer, from losing everything (the previous hard drive had installed original win10) to a series of very annoying setbacks like this. I cannot post images, I have no more than 10 reputations.
edit 1: there are the images:
https://ibb.co/jcNp05
https://ibb.co/hMyU05
The problem is that the video you posted is for linux, but i thank you for your help. I need now more he
You have to set a valid compiler to build your project. As any compiler is not set, it is asking you to check the configuration.
For example in my PC, I get the following as compiler output:
11:13:33: Running steps for project ListViewExample...
11:13:33: Configuration unchanged, skipping qmake step.
11:13:33: Starting: "C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\mingw32-make.exe"
C:/Qt/Qt5.2.1/Tools/mingw48_32/bin/mingw32-make -f Makefile.Debug
Here you can observe that C:/Qt/Qt5.2.1/Tools/mingw48_32/bin/mingw32-make is the make compiler which builds the application.
You can set the compiler path here:
Tools > Options > Build & Run > Kits. Select the kit displayed and select a
valid compiler.
How to add mingw compiler at the time of installation
Reference Video for similar issue
You can try this youtube video link. Hope this solves your problem.

Scalatra will not run on Windows

I have been working on a Scalatra project on a Linux environment and would now like to switch to a Windows environment. I've transferred the project folder to my Windows directory. Using Cygwyn, I cd to the Scalatra project and type
./sbt
> jetty:start
Nothing happens at this point. I have waited 10 minutes but nothing is printed to the console. I am having a hard time thinking of what might be the cause, since the exact same project works fine on Linux. Anyone have a Scalatra project working on Windows and remember whether there were any Windows-specific steps to set it up?
I did this on a fresh Windows 10 Professional VM in virtual box. I only allocated 1 CPU and 4 GB RAM, which may have made things unnecessarily slow. I was logged in as administrative user testvm
I always started new command prompts after modifying environment variables. All of my command prompts were run as administrator... I don't know whether that was necessary.
In general, these instructions were a good start: How to Install conscript in Windows, followed by http://scalatra.org/getting-started/first-project.html
installed the java developers kit, by visiting this page
or here
added the JDK's bin folder (C:\Program Files\Java\jdk1.8.0_131\bin) to the end of the PATH system variable
started a new command prompt and ran set to review the PATH environment variable, and ran javac –version as an additional sanity check
downloaded and installed sbt for windows. Didn't make any manual changes to the PATH at this point.
conscript (or giter8?) requires bash (and/or git?), so I installed git for windows. I did a default install, except I specified that git and "optional Linux components" should all be accessible form the windows prompt. I also added C:\Program Files\Git\bin to the PATH environment variable. I’m not sure if either or both of those tweaks are required.
downloaded the latest conscript jar. I got a warning that the download might not be safe and accepted anyway.
double clicked the conscript jar to run it. A nice graphical dialogue box came up and eventually told me that a cs.bat script had been created in C:\Users\testvm\.conscript\bin\cs.bat. 100% CPU use continued for several minutes after this and eventually I clicked the close button (X) in the upper right of the conscript installer dialogue.
When I installed conscript in another system more recently, it went quickly but I got a warning that cs.bat might not be on the system path.
ran conscript to obtain giter8. I have found that giter8 v 0.8 fails to build the skeleton project with an error like "parameters cannot contain '.'", so I specifically asked for v 0.7.2: C:\Users\testvm\.conscript\bin\cs.bat foundweekends/giter8/0.7.2
ran giter8 to install the skeleton scalatra project: C:\Users\testvm\.conscript\bin\g8.bat scalatra/scalatra-sbt
accepted all of the default parameters
turned off the windows firewall, the defender real-time protection, and started a new cmd prompt as administrator. I don’t know if any of those are necessary
ran sbt: c:\Users\testvm\my-scalatra-web-app\sbt
Going through this more recently, my-scalatra-web-app was installed into c:\Windows\System32\my-scalatra-web-app, but I was able to copy it to the top of C:\. cd'ing in there and running just sbt gave an error message, because there's a sbt file in that folder, but it's not a windows executable. So I entered "c:\Program Files (x86)\sbt\bin\sbt.bat". Subsequently, that directory was added to my PATH environment variable, so I could just enter sbt.bat
waited as components downloaded, installed and compiled
when the sbt > prompt reappeared, entered jetty:start and waited some more
eventually, the following appeared:
2017-05-09 07:31:15.101:INFO:oejs.ServerConnector:main: Started ServerConnector#bffcb98{HTTP/1.1}{0.0.0.0:8080}
2017-05-09 07:31:15.101:INFO:oejs.Server:main: Started #8698ms
Opened http://localhost:8080 in a web browser and saw Hello, world!

Could not locate deviceQuery on my installation Cuda toolkit v7.5 on Windows 10

As I was going through installing Cuda v7.5 following this link http://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/#compiling-examples
I was not able to verify the installation as described in section 2.5. Verify the Installation. The reason was because I could not find deviceQuery program that should have been located in
C:\ProgramData\NVIDIA Corporation\CUDA Samples\v7.5\bin\win64\Release
Therefore, I could not run the deviceQuery for Cuda to be verified. Where is deviceQuery program located ? Is it still precompiled and deployed by the installation ?
Okay, so if you are a complete noob like me in using Visual Studio then you might be thrown off by the instruction "build the application first". Just watch this video to get an idea of how to build and run a project/program using VS.
https://www.youtube.com/watch?v=cL05xtTocmY
As soon as you open VS (I am using 15.6), you will be prompted to upgrade the SDK. Make sure to do so. If you've misclicked or skipped upgrading, you can go to the Project pull down menu and click "Retarget Solution" and click ok on the menu that appears. Then build and debug as shown in the video.
Creating the deviceQuery.exe file:
Go to the (default) directory C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.2\1_Utilities\deviceQuery. Just follow the procedure of running the MatMul file but this time build the deviceQuery_vs2017.sln file and debug it. Remember to retarget the solution.
No, it's not precompiled any more.
You have to compile (build) the application first, before you can run it.
That is true for all the CUDA samples now.
OK, I've had this problem with CUDA Toolkit 10 under Windows 10. In my case, I do never use the admin account, and the installation was done from the user account, entering the admin password when necessary. After repeated trials, here's what worked for me:
Make sure to uninstall any old version of CUDA and Visual Studio
(just to have a clean start)
Restart the computer
Install Microsoft Visual Studio Community Edition. During the
install, make sure to select the C++ Development tools
Restart
Install the Cuda Toolkit
Restart
With this, I had all the files. But the deviceQuery still would not compile because it was targeted to an older version of Windows. To compile it, one needs to 'Retarget' the project to the current windows SDK. However, this doesn't work out-of-the-box because the 'deviceQuery_vs2017.vcxproj' file is read-only for regular users.
So, there are two possible solutions:
Copy the folder to some place where you have write permission, or
(This is what I used, for convenience) Using Windows Explorer, navigate to the C:\ProgramData\NVIDIA Corporation directory. Right click on the 'CUDA Samples' directory, select 'Properties'. Under the 'Security' tab, click 'Edit' and add your user to it.
This way you can Retarget the solution in place. After that, I could open the solution in MS Visual Studio, Retarget it, build it and test it, and all worked fine.
Hope that helps.

Unit Testing Windows 8 WIndows Runtime Component With TeamCity

I'm not a Windows 8 developer so excuse any stupid questions.
I have a Windows 8.1 application built in Visual Studio 2013 via a .sln file. This contains a number of projects: there is an application that relies on a library, this library (call it datalib) is built as a Windows Runtime Component (not a DLL);
there is also a test project which runs tests on 'datalib'
All of this works fine in VS2013, i.e. the tests execute.
I've been tasked with creating a TeamCity build for this so I've create a TeamCity build that builds against the sln file but I can't get the tests to execute (they're MSTest tests).
In my configuration I've added the test.dll (in the 'include assembly files list') but when I add this on it's own then I get a bunch of errors around references to types in the 'datalib'
The 'datalib' is built into datalib.winmd (I'm assuming this is the binary) so I thought that including this in the assembly list would fix my problem, but it doesn't.
I assume I'm missing something simple, what is it?
I'm now able to do this and it was a multi step process.
Firstly you don't load/test the winmd file directly you have to load the appx that's created by the test project 1; you can't use the MSTest runner that comes with TeamCity, instead you have to install the Visual Studio Test Runner plugin [2]; you have to run the build agent in an interactive process; and finally you have to install the root certificate that the application was signed with.
You reference the appx like you would a DLL
To install the build agent and have it run interactively it wasn't good enough to use the service and mark 'Interact with Desktop' you need to have full interaction so the agent has to be run from the desktop, as admin, at startup. To do this I had to create a scheduled task that run at startup and was given full privileges.
I installed the cert by running the ps1 file in the same directory as the appx file (Add-AppDevPackage.ps1) I'm sure this is overkill but it seemed like the easiest option at the time
[1] http://msdn.microsoft.com/en-us/library/hh691189.aspx
[2] https://confluence.jetbrains.com/display/TW/VSTest.Console+Runner

How to build a VS2010 C++ Project on a BuildServer

I've a .NET Solution with a managed C++ assemlby Targeting .NET 3.5 created with VS2010. The command:
%windir%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe MyProject.sln
compiles the solution on my dev machine.
On my BuildServer I get this error:
Build FAILED.
"F:\CruiseControl.NET\Projects\MyProject\MyProject.sln"
(default target) (1) ->
"F:\CruiseControl.NET\Projects\MyProject\MyProject\MyProject.csproj"
(default target) (2) ->
"F:\CruiseControl.NET\Projects\MyProject\MyProjectMAPIHelper\MyProjectMAPIHelper.vcxproj"
(default target) (3) ->
F:\CruiseControl.NET\Projects\MyProject\MyProjectMAPIHelper\MyProjectMAPIHelper.vcxproj(23,3):
error MSB4019: The imported project
"C:\Program
Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.Default.props"
was not found. Confirm that the path
in the <Import> declaration is
correct, and that the file exists on
disk.
0 Warning(s)
1 Error(s)
On my dev machine the claimed file
"C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.Default.props"
exists. On my build server not.
When I try to copy this files (and all others in the same directory) other errors occurred. So this is the wrong way.
EDIT: other errors means: When I copy the file "Microsoft.Cpp.Default.props" on the build server, MSBuild is claiming other files. That shows me, that just doing a copy of missing files is not what the build environment is expecting. I am looking for an MSI/whatever package that I could install on my build server and any C++ Project will build. Installing the SDK did not the trick. Or I did something wrong during SDK installation. Or it is not possible to compile Managed C++ VS2010 Solutions just with the SDK.
I believe that "other errors" has nothing to do with my problem. My Problem is: "How do I setup my build environment correctly". /EDIT
What I've done till now:
I have installed the latest Win7 SDK (Link)
I am targeting .net 3.5
I've tried playing with the Platform Toolset Property - but it was just playing
In my solution there is a managed C++ Assembly (my Problem)
I am using MSBuild 4.0 because the new VS2010 project files cannot be compiled with MSBuild 3.5
I am using CC.NET. compilation fails in CC.NET and on the command line. So it should not be a CC.NET issue.
Are there any tips and tricks how to configure my project properly to compile on my dev machine with VS2010 and on my build server? Is there anything more to install (except VS2010)?
Thanks, Arthur
For now, installing VS 2010 is your only safe option. The Windows SDK will be updated to enable your scenario, but I don't have a specific release date. Until then, you'll need to install VS 2010 with the C++ tools in order to build your 2010 solution with C++ projects. Make sure you let the C++ team know about how dissatisfaction with this situation via their team blog and/or MSDN Forum.
Even after installing VS 2010, you may need to invoke the appropriate vcvars*.bat file to setup your environment variables correctly.
Why don't you want to install VS2010 on your build server? If it's licencing, it's licenced per developer head not per install so I'm reasonably sure you are allowed to without buying another copy - or, at worst, you can install the express version which ought to at least install the config bits you're missing so you can use the platform SDK compiler.
If you're still having problems with msbuild you can then use devenv.com /build which exactly replicate the VS build env.
You may try those links:
http://social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/9055ca52-586b-459f-9dd1-a9d052d076b9/
or
http://msdn.microsoft.com/en-us/library/ee662426.aspx