Skip to content
Compiled text-based embeddable pure batch-scripts for searching of available MSBuild tools. VS2017+, VS2015, VS2013, VS2010, other versions from .NET Framework. Contains gnt.core for work with NuGet packages and more...
Branch: master
Clone or download
3F Public release of the hMSBuild 2.1
* NEW: Support for VS2019 msbuild (Thanks @gerhardol)

* CHANGED: Removed possible last extra slash `\` from path, ie. ~ `..\Bin\\MSBuild.exe`
           When x32 for searching from Visual Studio with `-notamd64` key.
           Part of PR #11

* CHANGED: Default remote vswhere is 2.6.7.
           https://github.com/microsoft/vswhere/releases/tag/2.6.7
Latest commit 4b368c9 May 27, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Public release of the hMSBuild 2.1 May 27, 2019
GetNuTool @ 4bc1dfb Updated GetNuTool v1.7 Dec 22, 2018
bin Initial version of the lightweight tool (a single compiled batch file… Apr 5, 2017
light Fixed broken CRLF from compressor & unit-tests May 24, 2017
minified Reviewed version from possible problems with special characters - #7 Dec 14, 2018
resources Reviewed version from possible problems with special characters - #7 Dec 14, 2018
tests Updated an default remote vswhere to 2.6.7 May 27, 2019
.gitattributes Public release of the hMSBuild v1.2.1 May 26, 2017
.gitignore Initial version of the lightweight tool (a single compiled batch file… Apr 5, 2017
.gitmodules
.version Public release of the hMSBuild 2.1 May 27, 2019
.vssbe Reviewed version from possible problems with special characters - #7 Dec 14, 2018
License.txt
Readme.md Public release of the hMSBuild 2.1 May 27, 2019
build.bat Updated GetNuTool v1.6.1 Aug 18, 2017
changelog.txt Public release of the hMSBuild 2.1 May 27, 2019
compress.bat Reviewed version from possible problems with special characters - #7 Dec 14, 2018
frontend.bat Updated an default remote vswhere to 2.6.7 May 27, 2019
hMSBuild.sln Fixed broken CRLF from compressor & unit-tests May 24, 2017
submodules.bat Updated GetNuTool v1.6.1 Aug 18, 2017
tests.bat Fixed broken CRLF from compressor & unit-tests May 24, 2017

Readme.md

hMSBuild

Compiled text-based embeddable pure batch-scripts (no powershell, no dotnet-cli) for searching of available MSBuild tools. VS2019+, VS2017 (it does not require local vswhere.exe [?]), VS2015, VS2013, VS2012, VS2010, other versions from .NET Framework. Contains gnt.core for work with NuGet packages and more...

Build status release-src License GetNuTool core

Build history

Download: Latest stable batch-script [ hMSBuild ]

Why hMSBuild ?

because you need simple access to msbuild tools and more...

Based on GetNuTool core https://github.com/3F/GetNuTool

  • Initially, it was part of this tool like a small msbuild-helper. Then, it has been extracted into the new project after major changes from MS for their products. Now we have more support of all this.

Today's hMSBuild provides flexible way to access to msbuild tools for any type of your projects. Just specify what you need in different environments. Look at #Algorithm of searching below.

{Screencast - hMSBuild in action. Demo via RunIlAsm error}

License

Licensed under the MIT License (MIT)

Copyright (c) 2017-2019  Denis Kuzmin < entry.reg@gmail.com > GitHub/3F

And the hMSBuild contributors: https://github.com/3F/hMSBuild/graphs/contributors

[ ☕ Donate ]

Features

Just a single batch file and no more for your happy build.

Combine this with your other available scripts or just type hMSBuild {arguments to original msbuild} and have fun.

Start with hMSBuild -h

What supports ?

  • Versions from VS2019+, VS2017

  • Versions from VS2015, VS2013, VS2012

  • Versions from .NET Framework, including for VS2010

Algorithm of searching

v2.0+

  • Versions:

    • VS2019+, VS2017 ➟ VS2015, VS2013, ... ➟ .netfx
  • Architectures (configure via -notamd64 key):

    • x64 ➟ x32
  • Priorities (configure via -vsw-priority and -stable keys). Specific workload components in more priority than pre-release products. See Issue #8

    1. Stable releases with selected workload components (C++ etc) ➟ Same via beta releases if allowed.
    2. Stable releases with any available components ➟ Same via beta releases if allowed.

Usage

Usage is same as it would be same for msbuild. But you also have an additional keys to configure hMSBuild and to access to GetNuTool.

hMSBuild - 2.0.0.61507 [ a40c6ac ]
Copyright (c) 2017-2018  Denis Kuzmin [ entry.reg@gmail.com ] :: github.com/3F

Distributed under the MIT license
https://github.com/3F/hMSBuild


Usage: hMSBuild [args to hMSBuild] [args to msbuild.exe or GetNuTool core]
------

Arguments:
----------
 -no-vs        - Disable searching from Visual Studio.
 -no-netfx     - Disable searching from .NET Framework.
 -no-vswhere   - Do not search via vswhere.

 -vsw-priority {IDs} - Non-strict components preference: C++ etc.
                       Separated by space: https://aka.ms/vs/workloads

 -vsw-version {arg}  - Specific version of vswhere. Where {arg}:
     * 1.0.50 ...
     * Keywords:
       `latest` - To get latest remote version;
       `local`  - To use only local versions;
                  (.bat;.exe /or from +15.2.26418.1 VS-build)

 -no-cache         - Do not cache vswhere for this request.
 -reset-cache      - To reset all cached vswhere versions before processing.
 -notamd64         - To use 32bit version of found msbuild.exe if it's possible.
 -stable           - It will ignore possible beta releases in last attempts.
 -eng              - Try to use english language for all build messages.
 -GetNuTool {args} - Access to GetNuTool core. https://github.com/3F/GetNuTool
 -only-path        - Only display fullpath to found MSBuild.
 -force            - Aggressive behavior for -vsw-priority, -notamd64, etc.
 -debug            - To show additional information from hMSBuild.
 -version          - Display version of hMSBuild.
 -help             - Display this help. Aliases: -help -h


------
Flags:
------
 __p_call - Tries to eliminate the difference for the call-type invoking hMSBuild.bat

--------
Samples:
--------
hMSBuild -notamd64 -vsw-version 1.0.50 "Conari.sln" /t:Rebuild
hMSBuild -vsw-version latest "Conari.sln"

hMSBuild -no-vswhere -no-vs -notamd64 "Conari.sln"
hMSBuild -no-vs "DllExport.sln"
hMSBuild vsSolutionBuildEvent.sln

hMSBuild -GetNuTool -unpack
hMSBuild -GetNuTool /p:ngpackages="Conari;regXwild"

hMSBuild -no-vs "DllExport.sln" || goto bx

Integration with other scripts

batch

hMSBuild is a pure batch script. Therefore, you can combine this even inside your other batch scripts. Or simply invoke this externally as you need:

~

set msbuild=hMSBuild -notamd64
...
%msbuild% Conari.sln /m:4 /t:Rebuild
for /F "tokens=*" %%i in ('hMSBuild -only-path -notamd64') do set msbuild="%%i"
...
%msbuild% /version

...

Build & Tests

Our build was based on vssbe scripts.

You don't need to do anything else, just navigate to root directory of this project, and:

.\build

Available tests can be raised by command:

.\tests

We're waiting for your awesome contributions!

You can’t perform that action at this time.