该包的EntityFramework上未安装项目 [英] The EntityFramework package is not installed on project

查看:1741
本文介绍了该包的EntityFramework上未安装项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到麻烦EF安装在我所谓的'匹配'非常简单的项目(刚才学习MVC,迟到总比不到好)。在此大背景下,是我创建的模型类只有2场,现在我想改变模型类有一些更多的字段/属性。我曾在Model类的变化,我现在试图更新数据库进行匹配。我试图用更新,数据库从EF做到这一点。


  

PM>安装包的EntityFramework
  您正在从微软下载的EntityFramework,许可协议,据此,可在<一href=\"http://go.microsoft.com/fwlink/?LinkId=253898&clcid=0x409\">http://go.microsoft.com/fwlink/?LinkId=253898&clcid=0x409.检查包装额外的依赖关系,这可能会带着自己的许可协议(S)。您使用的程序包和依赖关系构成您的许可协议的接受。如果您不接受许可协议(S),然后从设备中删除相关组件。
  安装成功的EntityFramework 5.0.0。
  添加成功'的EntityFramework 5.0.0相匹配。


  
  

键入获取帮助的EntityFramework看到所有可用的实体框架命令。


  
  

PM>启用的迁移
  GET-套餐:一个参数不能找到匹配的参数名称'项目名'。
  在C:\\用户\\戴夫\\文档\\ Visual Studio 2010的\\项目\\匹配\\包\\ EntityFramework.5.0.0 \\ TOOLS \\ EntityFramework.psm1:611字符:40
  + $ =包获取封装-ProjectName&LT;&LT;&LT;&LT; $ project.FullName | ?{$ _。标识-eq的EntityFramework'}
  + CategoryInfo:InvalidArgument:(:) [获取封装],ParameterBindingException
  + FullyQualifiedErrorId:NamedParameterNotFound,NuGet.PowerShell.Commands.GetPackageCommand


  
  

该包的EntityFramework上未安装项目的比赛。



解决方案

只要更新的NuGet到2.x的EF 5.0需要它。

I am having trouble getting the EF to install on my very simple project called 'Match' (just now learning MVC, better late than never). The general context here is that I created the Model class with only 2 fields and now I want to change the Model class to have a few more fields/properties. I have made the change in the Model class and am now trying to update the DB to match. I am trying to use Update-Database from EF to do that.

PM> install-package EntityFramework You are downloading EntityFramework from Microsoft, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkId=253898&clcid=0x409. 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 5.0.0'. Successfully added 'EntityFramework 5.0.0' to Match.

Type 'get-help EntityFramework' to see all available Entity Framework commands.

PM> Enable-Migrations Get-Package : A parameter cannot be found that matches parameter name 'ProjectName'. At C:\Users\Dave\Documents\Visual Studio 2010\Projects\Match\packages\EntityFramework.5.0.0\tools\EntityFramework.psm1:611 char:40 + $package = Get-Package -ProjectName <<<< $project.FullName | ?{ $_.Id -eq 'EntityFramework' } + CategoryInfo : InvalidArgument: (:) [Get-Package], ParameterBindingException + FullyQualifiedErrorId : NamedParameterNotFound,NuGet.PowerShell.Commands.GetPackageCommand

The EntityFramework package is not installed on project 'Match'.

解决方案

Just update NuGet to 2.x. EF 5.0 requires it.

这篇关于该包的EntityFramework上未安装项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆