C# EF添加ADO.NET实体数据模型时,产生.Desiger.cs文件为空

// T4 code generation is enabled for model 'D:\DKX4003\work\VWFC_CCS\SrcCCG-branch\CCGSPBOCOne-FCA\CUP\VWFC.IT.CUP.DAL\CupCreditQueryModel.edmx'. 
// To enable legacy code generation, change the value of the 'Code Generation Strategy' designer
// property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model
// is open in the designer.

// If no context and entity classes have been generated, it may be because you created an empty model but
// have not yet chosen which version of Entity Framework to use. To generate a context class and entity
// classes for your model, open the model in the designer, right-click on the designer surface, and
// select 'Update Model from Database...', 'Generate Database from Model...', or 'Add Code Generation
// Item...'.

原因:添加实体时“代码生成策略”  的值是为 “T4”

解决办法:在”关系图“空白处,即.edmx文件里的空白处右键选属性,找到“代码生成策略”,将值“T4”改为“Legacy ObjectContext”,保存后.Desiger.cs文件中就生成代码了。

同时删除多余的.Context.tt和.tt文件。

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值