Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw better error when git.exe cannot be found #350

Closed
ErikEJ opened this issue Jul 20, 2019 · 3 comments
Closed

Throw better error when git.exe cannot be found #350

ErikEJ opened this issue Jul 20, 2019 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@ErikEJ
Copy link

ErikEJ commented Jul 20, 2019

Currently, this unhelpful error message is thrown from here:

https://github.com/dotnet/sourcelink/blob/master/src/Microsoft.Build.Tasks.Git/GitDataReader/GitEnvironment.cs#L125

Error	MSB4018	The "Microsoft.Build.Tasks.Git.LocateRepository" task failed unexpectedly.
System.ArgumentNullException: Value cannot be null.
Parameter name: path1
   at System.IO.Path.Combine(String path1, String path2)
   at Microsoft.Build.Tasks.Git.GitEnvironment.FindSystemDirectory() in /_/src/Microsoft.Build.Tasks.Git/GitDataReader/GitEnvironment.cs:line 88
   at Microsoft.Build.Tasks.Git.GitEnvironment.CreateFromProcessEnvironment() in /_/src/Microsoft.Build.Tasks.Git/GitDataReader/GitEnvironment.cs:line 79
   at Microsoft.Build.Tasks.Git.GitEnvironment.Create(String configurationScope) in /_/src/Microsoft.Build.Tasks.Git/GitDataReader/GitEnvironment.cs:line 64
   at Microsoft.Build.Tasks.Git.RepositoryTask.GetOrCreateRepositoryInstance() in /_/src/Microsoft.Build.Tasks.Git/RepositoryTask.cs:line 112
   at Microsoft.Build.Tasks.Git.RepositoryTask.ExecuteImpl() in /_/src/Microsoft.Build.Tasks.Git/RepositoryTask.cs:line 65
   at Microsoft.Build.Tasks.Git.RepositoryTask.Execute() in /_/src/Microsoft.Build.Tasks.Git/RepositoryTask.cs:line 43
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()	EFCore.Analyzers	C:\Users\Erik\.nuget\packages\microsoft.build.tasks.git\1.0.0-beta2-19351-01\build\Microsoft.Build.Tasks.Git.targets	24	


Related issue: dotnet/efcore#16656

@tmat
Copy link
Member

tmat commented Jul 21, 2019

Dup of #337.

@tmat tmat closed this as completed Jul 21, 2019
@tmat tmat added the duplicate This issue or pull request already exists label Jul 21, 2019
@ErikEJ
Copy link
Author

ErikEJ commented Jul 21, 2019

Sorry, but I cannot see an improved error message in the fix !?

@ErikEJ
Copy link
Author

ErikEJ commented Jul 21, 2019

Ah, git.exe is not required at all!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants