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

fake -t registerSample throws Win32Exception: The system cannot find the file specified #11

Open
fbehrens opened this issue Aug 4, 2021 · 3 comments

Comments

@fbehrens
Copy link

fbehrens commented Aug 4, 2021

I am getting the same error on two win10 PCs.

More verbosity does not give me more information

PS C:\code\azure\AAD.fs> dotnet fake build -t registerSample
...
Starting target 'registerSample'
.> "az" account show --query tenantId --output tsv (In: false, Out: true, Err: true)
---------------------------------------------------------------------
Script reported an error:
-> BuildFailedException: Target 'registerSample' failed.
-> One or more errors occurred. (Start of process 'az' failed.)
-> Start of process 'az' failed.
-> Win32Exception: The system cannot find the file specified

PS C:\code\azure\AAD.fs> az --version
azure-cli                         2.27.0
Your CLI is up-to-date.

PS C:\code\azure\AAD.fs> az account show --query tenantId --output tsv
e04f0ef7-9398-4c7e-b22d-df1496f3ad32

> dotnet --version # tried both
3.1.401 [C:\Program Files\dotnet\sdk]
5.0.302 [C:\Program Files\dotnet\sdk]
@et1975
Copy link
Member

et1975 commented Sep 28, 2021

Thanks, I haven't tried it on Windows, I'm guessing "az" is called something else on Windows, like "az.bat" or some such. I'll check.

@fbehrens
Copy link
Author

I have looked into it and "it looked" like az.cmd is the excecutable on windows, and looks

@IF EXIST "%~dp0\..\python.exe" (
  SET AZ_INSTALLER=MSI
  "%~dp0\..\python.exe" -IBm azure.cli %*
) ELSE (
  echo Failed to load python executable.
  exit /b 1
)

It is calling a vendored python.exe which is addressed relative to the az.cmd file via %~dp0.

The latter does not work with the Fake.Core.CreateProcess used here

However

@et1975
Copy link
Member

et1975 commented Sep 29, 2021

hm, yeah... so just calling "az.cmd" doesn't work either. Bummer, guess we'll have to find another way to start it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants