Workaround: The "add-migration" item cannot be identified as a cmdlet, function, script file, or name of a executable program. Check the spelling of the name, if the path is included, make sure the path is correct, and then try again

Source: Internet
Author: User

1, the input of the underlined "-" format is not correct, check whether it is full-width input, mistakenly entered the underscore "_", or there are spaces before and after;

2. Do not refer to the EntityFramework command, please perform the following name (Import-module project Path \packages\entityframework.6.1.3 (EF version) \tools\ ENTITYFRAMEWORK.PSD1)

It is also important to note that when executing a command, the default project must select the project that contains the model

If none of the above is resolved, then perform the #2有提示:

Then you need to follow the instructions above, open cmd and go to PowerShell.

Execute First:

1. Cmd->powershell, enter the PowerShell mode, after successful, will appear on the left side of the command line PS Word;

2. Cmd->get-executionpolicy, see if our current scope has the command to execute PowerShell;

3. Cmd->get-executionpolicy-list View all current scopes

Ok, all scopes do not have permissions, then we need to set permissions to it, set permissions see the Fourth step

4.cmd->set-executionpolicy Remotesigned-scope CurrentUser, set the current user scope with permissions, the format is as follows: Set-executionpolicy- ExecutionPolicy <PolicyName>-scope <scope>

Ok, last set has permission, finally we are going to try Add-migration

The final execution was successful.

Powersheel Please refer to the official information: https://technet.microsoft.com/zh-CN/library/hh847748.aspx

Workaround: The "add-migration" item cannot be identified as a cmdlet, function, script file, or name of a executable program. Check the spelling of the name, if the path is included, make sure the path is correct, and then try again

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.