There may be situations where building the project from the command line becomes inevitable. I was put into a similar situation where I had to setup a continuous integration for Windows Projects. At this point of time I had to explore how to build the projects from the command line so that I could write the required scripts for continuous integration of Windows Projects using tools like Jenkins, etc.
I will also be posting an article on how to automate the building process or achieve continuous integration for a UWP (or any windows App) using Jenkins in near future. But the perquisite is to understand how to build applications from the command line. So let’s get started.
We have two approaches to achieve what is mentioned in the title:
First Approach: Using MsBuild[ <path to>msbuild.exe <path to>solution/project file ]
Step 1: Navigate to the folder where MSBuild resides (Refer Above links for more info)
Step 2:Now Build the project using MSBuild,
Step 3:The Build succeeds.
- MSBuild MyApp.sln /t:Rebuild /p:Configuration=Release
MSBuild MyApp.csproj /t:Clea /p:Configuration=Debug;TargetFrameworkVersion=v3.5
- C:/WINDOWS/Microsoft.NET/Framework64/v4.0.30319>msbuild.exe "C:/Users/Saurabh/Documents/Visual Studio 2015/Projects/SimplyNote/SimplyNote.sln" Configuration="Release"
Second Approach: Using devenv(requires Visual Studio installed) [ devenv /build Release Solution.sln | devenv /build Debug Solution.sln ].
Step 1:Open the Visual Studio Developer Console/prompt.
Step 2:The Visual Studio Developer console/prompt opens.
Step 3:Use the devenv command to build the Solution(.sln) file. Make sure you give proper path to the solution file.
C:/Program Files (x86)/Microsoft Visual Studio 14.0>devenv /build Release "C:/Users/Saurabh/Documents/Visual Studio 2015/Projects/SimplyNote/SimplyNote.sln"
Step 4:The Build Succeeds.
All the above screenshots are present in the attachment zip that you can download.
Read more articles on Universal Windows Platform :
转载本站任何文章请注明：转载至神刀安全网，谢谢神刀安全网 » Compile/Build The UWP Project From The Command Line