2017-10-18 3 views
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,Impossible d'activer la migration dans VS2013 ultime

le résultat est:

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> 

Puis, je Install-Package EntityFramework

L'erreur est:

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> 
+0

Copie possible de [Console Manager du Gestionnaire d'ensembles - Migrations CommandNotFoundException uniquement dans un projet VS spécifique] (https://stackoverflow.com/questions/10411529/package-manager-console-enable-migrations-commandnotfoundexception-only-in- a-spe) – Riv

Répondre

0

Sapins t exécuter cette

Uninstall-Package EntityFramework -Force

Puis

Install-Package EntityFramework

Redémarrez ensuite en tant qu'administrateur.

+1

merci beaucoup. mais le problème persiste toujours. – newbuntu

+0

, j'ai essayé la méthode dans tous les postes. aucun d'entre eux ne peut résoudre cela. – newbuntu

+0

Merci beaucoup mesdames et messieurs. Je parviens à le résoudre. C'est une erreur que j'ai faite en tant que débutant: permettre la migration sans charger un projet. Après avoir chargé un projet, je parviens à l'activer. Merci beaucoup à tous. C'est mon ignorance qui a causé cette erreur. À votre santé! – newbuntu