0
In package Manager Console, I type `enable-migrations`,  The output shows error :

    PM> enable-migrations
    The term 'enable-migrations' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a pa
    th was included, verify that the path is correct and try again.
    At line:1 char:18
    + enable-migrations <<<< 
        + CategoryInfo          : ObjectNotFound: (enable-migrations:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException

I also try to install

    PM> Install-Package EntityFramework -IncludePrerelease
    Install-Package : The current environment doesn't have a solution open.
    At line:1 char:16
    + Install-Package <<<<  EntityFramework -IncludePrerelease
        + CategoryInfo          : InvalidOperation: (:) [Install-Package], InvalidOperationException
        + FullyQualifiedErrorId : NuGetNoActiveSolution,NuGet.PowerShell.Commands.InstallPackageCommand

    PM> 

the problem still exist.

I am new to entity framework. Please help.

Thank you very much.

Cheers,
newbuntu


@TAHA SULTAN TEMURI, many thanks.  I use run as administrator and

Uninstall-Package EntityFramework -Force,

the result is :

PM> Uninstall-Package EntityFramework -Force
Uninstall-Package : The current environment doesn't have a solution open.
At line:1 char:18
+ Uninstall-Package <<<<  EntityFramework -Force
    + CategoryInfo          : InvalidOperation: (:) [Uninstall-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetNoActiveSolution,NuGet.PowerShell.Commands.UninstallPackageCommand

PM> 

Then, I Install-Package EntityFramework

The error is :

PM> Uninstall-Package EntityFramework -Force
Uninstall-Package : The current environment doesn't have a solution open.
At line:1 char:18
+ Uninstall-Package <<<<  EntityFramework -Force
    + CategoryInfo          : InvalidOperation: (:) [Uninstall-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetNoActiveSolution,NuGet.PowerShell.Commands.UninstallPackageCommand

PM> Install-Package EntityFramework
Install-Package : The current environment doesn't have a solution open.
At line:1 char:16
+ Install-Package <<<<  EntityFramework
    + CategoryInfo          : InvalidOperation: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetNoActiveSolution,NuGet.PowerShell.Commands.InstallPackageCommand

PM> 
newbuntu
  • 57
  • 6
  • Possible duplicate of [Package Manager Console Enable-Migrations CommandNotFoundException only in a specific VS project](https://stackoverflow.com/questions/10411529/package-manager-console-enable-migrations-commandnotfoundexception-only-in-a-spe) – Riv Oct 18 '17 at 10:21

1 Answers1

0

First run this

Uninstall-Package EntityFramework -Force

Then

Install-Package EntityFramework

Then restart as administrator.

  • , I have try al the method in all the post. none of them can solve this. – newbuntu Oct 18 '17 at 10:44
  • Many thanks ladies and gentlemen. I manage to solve it. It is a mistakes I done as a newbie : enable migration without loading a project. After load a project, I manage to enable it. Many many thanks to all. It is my ignorance that has causing this error. Cheers! – newbuntu Oct 19 '17 at 22:20