-
Notifications
You must be signed in to change notification settings - Fork 378
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
The system cannot find the file specified #1663
Comments
Where is the file build.bat located? If it's at the root of your template output, it should work. If it's in a subdirectory of the template output, you'll need to give the relative path in the post action configuration. For example:
|
I believe you need to set the executable to “cmd.exe” and the args property to “/c {the relative path to your batch file}” |
Closing this since we haven't heard back. Please let us know if this is still an issue |
I have the same issue. Because preferNameDirectory is true dotnet will create a folder for the project so "executable" should be ProjectName\build.bat instead of build.bat. Is there any variable I can use in the executable variable? I tried the same value as the sourceName but it does not work. |
@ADIX7 could you post more details please? A link to the right files in a repository would be best, otherwise the contents of template.json and the file/directory structure of your template content would also work |
template.json: https://pastebin.com/Vh5a7Gu3 When preferNameDirectory is false, dotnet new will create all the content in the current directory. In my case there will be an initTemplate.sh (and an initTemplate.ps1 but lets focus to linux, same happens on both platform) file. I start it with 'Run script' (3A7C4B45-1F5D-4A30-959A-51B88E82B5D2) post action. When preferNameDirectory is false initTemplate.sh will be in the current folder. When preferNameDirectory is true dotnet new will create a VMTS.Web.Tutorial_ClassDiagram folder (if you run the command I gave above) and the content will go there. But the run script post action will try to run initTemplate.sh instead of VMTS.Web.Tutorial_ClassDiagram/initTemplate.sh So preferNameDirectory: true will create a folder but run script post action does not handle this. There could be several solutions: |
That's exactly the information I was looking for, thanks! We'll hopefully get to dig in to this more soon. |
Your welcome :) Looking forward for the results. |
Would you also be able to provide the output of |
On Ubuntu 18.04 with dotnet 2.2.103 $ dotnet new --debug:version Permission denied to modify the '/usr/share/dotnet/sdk/NuGetFallbackFolder' folder. Here are some options to fix this error:
Template Instantiation Commands for .NET Core CLI Version: 1.0.2-beta4 |
This is happening to me as well. I have work around but they are not appealing to look at in the command window. |
I have the same issue. {
"actionId": "3A7C4B45-1F5D-4A30-959A-51B88E82B5D2",
"args": {
"executable": "seed.cmd",
"args": ""
},
"manualInstructions": [
{
"text": "Run 'seed.cmd'"
}
],
"continueOnError": true,
"description ": "Seeds the system"
} Output:
It's a real blocker at the moment, anything I can do at all? |
I have same issue. I was able to make it work on Mac with bash script, but not able to get it work on windows machine with batch file. I tried to describe my workflow as clear as possible. please let me know how can I get this working on windows. my use case is -
"symbols": {
"InputSpec": {
"type": "parameter",
"datatype": "string",
"defaultValue": "",
"replaces": "swagger-spec",
"description": "The value of this symbol replaces 'swagger-spec' in the generated content"
}
}, {
"actionId": "3A7C4B45-1F5D-4A30-959A-51B88E82B5D2",
"description ": "copies input swagger spec by calling copy-spec.cmd",
"condition": "(OS == \"Windows_NT\")",
"manualInstructions": [{ "text": "Run 'postActionScripts\\copy-spec.cmd'" }],
"continueOnError": false,
"args": {
"executable": "'postActionScripts\\copy-spec.cmd",
"args": ""
}
} my template folder structure (removed other content for brevity).
dotnet new command dotnet new agwebapi -n ProductApi --InputSpec c:\swaggerspecs\some-swagger.json --allow-scripts yes here is dotnet new version
|
I'm running into this issue as well. |
|
Not sure if it's the same bug, because it's happening only on Windows. I have a postprocessing folder which contains several text files. The following post-action code to remove this folder doesn't work, throwing error that it wasn't found:
I've tried "postprocessing", ./postprocessing, .\\postprocessing etc., no luck. Absolute path isn't an option obviously. At the same time, the Powershell workaround below does work.
For Linux I use |
Hello @MaxCrank, yes, it seems like you had not the same bug as others. My understanding at the moment that |
Fixed. Implemented search logic: first, search for the executable file in the template base folder, then, if no file has been found, the executable should be searched in the directories from PATH. |
…n run scripts post action
…n run scripts post action
Hi there,
Trying to run a post action but it seems to be failing with the message below:
Running command 'build.bat'...
The system cannot find the file specified
my template.json looks like this:
{
"author": "xxx",
"classifications": [ "Web" ],
"name": "Project",
"identity": "Project",
"shortName": "Project",
"tags": {
"language": "C#"
},
"sourceName": "Net.Project",
"preferNameDirectory" : "true",
"postActions": [{
"actionId": "3A7C4B45-1F5D-4A30-959A-51B88E82B5D2",
"args": {
"executable": "build.bat",
"args": ""
},
"manualInstructions": [{
"text": "Run 'build.bat'"
}],
"continueOnError": "true",
"description ": "setups the project by calling build.bat"
}]
}
The command I am running is like this:
dotnet new Net.Project -o SuperUperDuper
It creates the project, copy all the files to folder appropriately but it fails with the system cannot find the file.
Any clues?
Thanks in advance.
The text was updated successfully, but these errors were encountered: