EntityFramework.6.1.2-beta1 \ tools \ init.ps1 limited, cannot enable enable-migrations Command

Visual Studio 2013 C # ASP.NET MVC EntityFramework.6.1.2-beta1 \ tools \ init.ps1 problem cannot be loaded because its execution is blocked by software restriction policies. Contact your system administrator for more information.

When I try to use Enable-Migrations: I get the message below: The term "Enable-Migrations" is not recognized as the name of the cmdlet, function, script file or executable program. Check the spe lling of the name, or if the path was included, check the path is correct and try again. On line: 1 char: 18 + Enable-Migrations <<+ CategoryInfo: ObjectNotFound: (Enable-Migrations: String) [], CommandNotFoundException + FullyQualifiedErrorId: CommandNotFoundException

I have a problem above, and I tried all kinds of solutions for it, but none of them helped

Things I've already done:

  • uninstalled all nuget extension and installed it again (didn't work)
  • Entity Framework removed and installed again (not working)
  • closed my visual studio 2013 and opened the file again (did not work)
  • Open visual studio using admin (not working)
  • The remote package was packaged from another project (did not work)

I even tried some power shell commands, still not working.

+4
source share
2 answers

I found a solution to my problem. The reason is because my user profile somehow blocked me from running the init.ps1 EntityFramework file. I created a new user profile with administrator rights and Ran Visual Studio in this profile, and now EntityFramework works fine. If you run into the same problem, try the above that I already tried, and if none of them work, try this.

Luck

+2

- .

PS:

Set-ExecutionPolicy RemoteSigned

. : https://technet.microsoft.com/en-us/library/hh849812.aspx

+1

All Articles