none
Cmd.exe exited with code '1' RRS feed

  • Question

  • Hello,

    I have a question about visualstudio.com so I think this is the proper forum section to ask about it.

    First of all, on the website myname.visualstudio.com/MyAppName/_build/results?buildId=123 I receive an error in EF Core migrations step ("Cmd.exe exited with code '1'). The command I execute is: 

    dotnet ef migrations script --project $(Build.SourcesDirectory)\MyAppName\MyAppName.csproj --output $(build.artifactstagingdirectory)\migrations\scripts.sql --idempotent --startup-project $(Build.SourcesDirectory)\MyAppName\MyAppName.csproj

    And the command output has this:

    dotnet ef migrations script --project D:\a\1\s\MyAppName\MyAppName.csproj --output D:\a\1\a\migrations\scripts.sql --idempotent --startup-project D:\a\1\s\MyAppName\MyAppName.csproj
    ========================== Starting Command Output ===========================
    ##[command]"C:\windows\system32\cmd.exe" /D /E:ON /V:OFF /S /C "CALL "D:\a\_temp\[here there was some id].cmd""
    Could not execute because the specified command or file was not found.
    Possible reasons for this include:
      * You misspelled a built-in dotnet command.
      * You intended to execute a .NET Core program, but dotnet-ef 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.
    ##[error]Cmd.exe exited with code '1'.

    It was working previously. I haven't changed the command but it stopped working.

    The second question is related to "Anonymous access is enabled on the App Service app. Users will not be prompted for login" message that I have found on portal.azure.com. What exactly does it mean? Is this some kind of security gap in my configuration? How to change it?

    Thank you!

    Saturday, November 16, 2019 2:48 PM

All replies

  • Did you add these packages also?

    dotnet add package Microsoft.EntityFrameworkCore.Design

    Install-Package Microsoft.EntityFrameworkCore.Toolshttps://docs.microsoft.com/en-us/ef/core/get-started/install/

    Sunday, November 17, 2019 1:30 AM
  • Hi Rafal369,

    Welcome to MSDN forum.

    Did you try Ken’s suggestions? And if you don’t change the command, I’m not sure if the path has been modified by accident?

    Maybe you could follow the error message and check the path or some related files are exactly under the corresponding directory.

    Which kind of agent do you use? Since our forum discusses about the usage of tools and Editors in Visual Studio, I recommend you could redirect to stack overflow tagged azure and devops and start a new thread, engineer there will explain your second question and share you with solutions about your first issue.

    Thanks for your understanding.

    Best Regards,

    Tianyu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, November 18, 2019 10:03 AM
  • Hi Tianyu and Ken,

    thank you a lot for your responses. Yes, I have tried these suggestions. I was able to change Microsoft.EntityFrameworkCore.Tools version from 2.1.1 to 2.2.6 and add Microsoft.EntityFrameworkCore.Design version 3.0.0.

    I couldn't update Microsoft.EntityFrameworkCore.Tools to 3.0.0 because of the following error:

    Package Microsoft.EntityFrameworkCore.Tools 3.0.1 is not compatible with netcoreapp2.1 (.NETCoreApp,Version=v2.1). Package Microsoft.EntityFrameworkCore.Tools 3.0.1 supports: netstandard2.1 (.NETStandard,Version=v2.1)

    >> And if you don’t change the command, I’m not sure if the path has been modified by accident?

    I suspect this is the change in the way how "dotnet ef" works. I have found this article (https://www.learningpenguin.net/2019/10/08/cannot-create-initial-migration-with-dotnet-ef-command-in-net-core/) in which the autor suggests that this command line tool is removed from the .NET Core SDK. But this article does not say anything about Azure. Could you, please, suggest me what I should do on Azure?

    I know that Stack Overflow is a great source of knowledge but I always hesitate to use it, as code snippets and such are placed there under CC-BY-SA license which has some disadvantages.

    Thank you in advance for your help!

    Cheers :-)
    • Edited by Rafal369 Tuesday, November 19, 2019 4:47 PM Edited hyperlink
    Tuesday, November 19, 2019 4:47 PM
  • Hi Rafal369,

    Sorry for delay in reply.

    About your issue, actually it is out of our Visual Studio General Questions support scope. I have tried to research more, but didn’t find some workarounds.

    As there might be some inconvenience like you said, I recommend if possible, you could redirect to Developer Community and get further support there.

    I’m really sorry for any inconvenience.  

    Sincerely,

    Tianyu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, November 22, 2019 6:55 AM