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

dotnet script Could not execute because the specified command or file was not found #738

Closed
stealthAngel opened this issue Oct 3, 2023 · 2 comments

Comments

@stealthAngel
Copy link

stealthAngel commented Oct 3, 2023

For some reason, my dotnet script does not work anymore.

What I probably did was trying to run dotnetscript from cmd

when I try to do it again in packagemanager console it does not work anymore. Maybe I have to clear the cache or something.

I tried making a test.csx

My error log:

Mode LastWriteTime Length Name


d----- 10/3/2023 10:53 PM BatFiles
d----- 9/10/2023 2:13 PM bin
d----- 9/30/2023 7:19 PM Generate
d----- 10/3/2023 10:53 PM obj
d----- 9/11/2023 5:33 PM Roles
-a---- 10/3/2023 10:53 PM 927 Zgenerate.csproj
-a---- 9/20/2023 10:36 PM 3092 DirectoryService.cs
-a---- 9/20/2023 10:36 PM 500 GenerateSettings.cs
-a---- 10/3/2023 10:56 PM 33 test.csx
-a---- 5/13/2023 6:36 PM 84 tgconfig.json

PM> dotnet script test.csx
dotnet : Could not execute because the specified command or file was not found.
At line:1 char:1

  • dotnet script test.csx
  •   + CategoryInfo          : NotSpecified: (Could not execu... was not found.:String) [], RemoteException
      + FullyQualifiedErrorId : NativeCommandError
    
    

Possible reasons for this include:

  • You misspelled a built-in dotnet command.
  • You intended to execute a .NET program, but dotnet-script does not exist.
  • You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
    image

image

image

@seesharper
Copy link
Collaborator

Could you try dotnet script --info ?

@stealthAngel
Copy link
Author

Solved it by uninstalling and reinstalling it. Then adding it manually to my path environments

open package manger console:

dotnet tool uninstall dotnet-script -g

dotnet tool install -g dotnet-script

image

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