Solucionado (ver solução)
Solucionado
(ver solução)
9
respostas

Não reconhece o método OnConfiguring

Estou usando o Visual Studio 2012. Usando os comandos do curso, não obtive sucesso na instalação:

Each package is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Some packages may include dependencies which are governed by additional licenses. Follow the package source (feed) URL to determine any dependencies.

Package Manager Console Host Version 2.6.40627.9000

PM> install-package entityframework.microsoftsqlserver -pre install-package : Unable to find package 'entityframework.microsoftsqlserver'. At line:1 char:1 + install-package entityframework.microsoftsqlserver -pre + ~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

PM> Install-Package EntityFramework.MicrosoftSqlServer -Pre Install-Package : Unable to find package 'EntityFramework.MicrosoftSqlServer'. At line:1 char:1 + Install-Package EntityFramework.MicrosoftSqlServer -Pre + ~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

PM> Install-Package EntityFramework.Commands -Version 7.0.0-rc1-final -pre Install-Package : 'EntityFramework.Commands' already has a dependency defined for 'EntityFramework.Relational.Design'. At line:1 char:1 + Install-Package EntityFramework.Commands -Version 7.0.0-rc1-final -pr ... + ~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

Depois, pesquisei no Fórum e segui os dois comandos:

Install-Package EntityFramework.MicrosoftSqlServer -Version 7.0.0-rc1-final -Pre

Install-Package EntityFramework.Commands -Version 7.0.0-rc1-final -Pre

Mas, mesmo assim, obtive erro:

Each package is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Some packages may include dependencies which are governed by additional licenses. Follow the package source (feed) URL to determine any dependencies.

Package Manager Console Host Version 2.6.40627.9000

Type 'get-help NuGet' to see all available NuGet commands.

PM> Install-Package EntityFramework.MicrosoftSqlServer -Version 7.0.0-rc1-final -Pre Installing 'EntityFramework.MicrosoftSqlServer 7.0.0-rc1-final'. You are downloading EntityFramework.MicrosoftSqlServer from Microsoft, the license agreement to which is available at http://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device. Successfully installed 'EntityFramework.MicrosoftSqlServer 7.0.0-rc1-final'. Adding 'EntityFramework.MicrosoftSqlServer 7.0.0-rc1-final' to lojaComEntity_. Uninstalling 'EntityFramework.MicrosoftSqlServer 7.0.0-rc1-final'. Successfully uninstalled 'EntityFramework.MicrosoftSqlServer 7.0.0-rc1-final'. Install failed. Rolling back... Install-Package : Could not install package 'EntityFramework.MicrosoftSqlServer 7.0.0-rc1-final'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. At line:1 char:1 + Install-Package EntityFramework.MicrosoftSqlServer -Version 7.0.0-rc1 ... + ~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

PM> Install-Package EntityFramework.Commands -Version 7.0.0-rc1-final -Pre Install-Package : 'EntityFramework.Commands' already has a dependency defined for 'EntityFramework.Relational.Design'. At line:1 char:1 + Install-Package EntityFramework.Commands -Version 7.0.0-rc1-final -Pr ... + ~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

Poderiam solucionar para mim? Obrigado.

9 respostas

Olá, Freedy!

Rode as seguintes linhas no Package Manager Console do NuGet:

Install-Package EntityFramework.MicrosoftSqlServer -Version 7.0.0-rc1-final -Pre
Install-Package EntityFramework.Commands -Version 7.0.0-rc1-final -pre

Boa sorte e bons estudos!

Não deu certo, olha o erro:

Install-Package EntityFramework.MicrosoftSqlServer -Version 7.0.0-rc1-final -Pre Installing 'EntityFramework.MicrosoftSqlServer 7.0.0-rc1-final'. You are downloading EntityFramework.MicrosoftSqlServer from Microsoft, the license agreement to which is available at http://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device. Successfully installed 'EntityFramework.MicrosoftSqlServer 7.0.0-rc1-final'. Adding 'EntityFramework.MicrosoftSqlServer 7.0.0-rc1-final' to lojaComEntity. Uninstalling 'EntityFramework.MicrosoftSqlServer 7.0.0-rc1-final'. Successfully uninstalled 'EntityFramework.MicrosoftSqlServer 7.0.0-rc1-final'. Install failed. Rolling back... Install-Package : Could not install package 'EntityFramework.MicrosoftSqlServer 7.0.0-rc1-final'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. At line:1 char:1 + Install-Package EntityFramework.MicrosoftSqlServer -Version 7.0.0-rc1 ... + ~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

PM> Install-Package EntityFramework.Commands -Version 7.0.0-rc1-final -pre Install-Package : 'EntityFramework.Commands' already has a dependency defined for 'EntityFramework.Relational.Design'. At line:1 char:1 + Install-Package EntityFramework.Commands -Version 7.0.0-rc1-final -pr ... + ~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException

Olá, Freedy

  1. Clique com o botão direito sobre o nome do projeto, vá na aba Application, abra a lista de opções Target Framewor e mude de .NET Framework 4.5 para 4.5.2

  2. Rode as seguintes linhas no Package Manager Console do NuGet:

Install-Package EntityFramework.MicrosoftSqlServer -Version 7.0.0-rc1-final -Pre
Install-Package EntityFramework.Commands -Version 7.0.0-rc1-final -pre

No meu VS 2012 não tenho o .NET Framework 4.5.2 Cliquei para baixar uma nova versão no site da Microsoft - https://www.microsoft.com/net/targeting - e estou em dúvida qual devo instalar:

.NET Framework 4.5.2 Developer Pack

.NET Framework 4.5.2 Language Packs

.NET Framework 4.5.2 Runtime

Freedy, você deve baixar o Developer Pack: https://www.microsoft.com/en-us/download/details.aspx?id=42637

Boa sorte e bons estudos!

Ok, já tinha iniciado. Suspeitei, mas não estava certo. Vou instalar quando terminar e atualizo o post.

Obrigado.

solução!

Deu certo, depois de instalar o .NET Frameword 4.5.2 e reiniciar o VS2012. foi reconhecido o método onConfiguring.

Obrigado.

Excelente, Freedy!