You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Diagnosing the case when "git" is not present in PATH.
Description
When "git" is not present in PATH, the following type of message is shown in an IDE:
The underlying problem is only visible in the build log:
1>Unhandled exception. System.InvalidOperationException: "git" is not present in PATH.
1> ---> System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'git' with working directory 'Y:\adamralph\simple-exec\SimpleExec'. The system cannot find the file specified.
1> at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
1> at System.Diagnostics.Process.Start()
1> at MinVer.Lib.GitCommand.TryRun(String args, String workingDirectory, ILogger log, String& output) in /_/MinVer.Lib/GitCommand.cs:line 32
1> --- End of inner exception stack trace ---
1> at MinVer.Lib.GitCommand.TryRun(String args, String workingDirectory, ILogger log, String& output) in /_/MinVer.Lib/GitCommand.cs:line 36
1> at MinVer.Lib.Versioner.GetVersion(String workDir, String tagPrefix, String defaultPreReleasePhase, ILogger log) in /_/MinVer.Lib/Versioner.cs:line 38
1> at MinVer.Lib.Versioner.GetVersion(String workDir, String tagPrefix, MajorMinor minMajorMinor, String buildMeta, VersionPart autoIncrement, String defaultPreReleasePhase, ILogger log, Boolean ignoreHeight) in /_/MinVer.Lib/Versioner.cs:line 18
1> at MinVer.Program.<>c__DisplayClass1_0.<Main>b__0() in /_/minver-cli/Program.cs:line 81
1> at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass143_0.<OnExecute>b__0(CancellationToken _)
1> at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
1> at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
1> at MinVer.Program.Main(String[] args) in /_/minver-cli/Program.cs:line 88
With this enhancement, an MSBuild error is produced when "git" is not present in PATH.
Error code: MINVER1007
Error message: "git" is not present in PATH
Alternatives
Keep things as they are and require users to look at the build log to determine that the underlying problem is that "git" is not present in PATH.
Additional context
Thanks to @marinusmaurice for making me aware of this potential enhancement in #776.
The text was updated successfully, but these errors were encountered:
adamralph
changed the title
Produce an MSBuild error when "git" is not present in PATH
Produce an MSBuild error when Git is not present in PATH
Jul 21, 2024
Use case(s)
Diagnosing the case when "git" is not present in PATH.
Description
When "git" is not present in PATH, the following type of message is shown in an IDE:
The underlying problem is only visible in the build log:
With this enhancement, an MSBuild error is produced when "git" is not present in PATH.
MINVER1007
Alternatives
Keep things as they are and require users to look at the build log to determine that the underlying problem is that "git" is not present in PATH.
Additional context
Thanks to @marinusmaurice for making me aware of this potential enhancement in #776.
The text was updated successfully, but these errors were encountered: