MSTest dotnet Test failing from the command prompt

I have a TestMethod that clones a git repo and then performs some operations on the folder.

When I run this test from VS test explorer, I do not have issues, However, when i run the same test from the command line using dotnet Test I get an error. I am assuming its because the enivornment im running that from does not have Git installed so it failed.

After researching online, the only solution I got was to add the git.exe file to my test project and a make sure to set the Copy to Output Directory to Copy if newer or Copy always and then use the that file path in my ProcessStartInfo method but that didnt work either. Got the error error launching git: The system cannot find the path specified.

What else can I do?
Was this page helpful?