entity-framework - 默认目标 Entity Framework 版本需要 edmx 架构版本 2.0.0.0 或更低版本。指定的架构是版本 3.0.0.0

标签 entity-framework edmgen

我使用 EdmGen.exe 在 Entity Framework 5.0 中预生成 View ,如下所示:

"%windir%\Microsoft.NET\Framework\v4.0.30319\EdmGen.exe" 
/nologo 
/mode:ViewGeneration 
/inssdl:"$(TargetDir)Base.ssdl" 
/incsdl:"$(TargetDir)Base.csdl" 
/inmsl:"$(TargetDir)Base.msl" 
/outviews:"$(ProjectDir)BaseViews.cs" 
/language:CSharp

警告详情:

Warning 3 The default target Entity Framework version requires the edmx schema version 2.0.0.0 or lower. The specified schema is version 3.0.0.0. To avoid this warning specify the target Entity Framework version explicitly. You can do this by using the EdmGen.exe command-line tool with the targetVersion option, or by including the targetEntityFrameworkVersion parameter when calling the GenerateCode method.

知道如何解决这个问题吗?

最佳答案

你需要添加 /targetversion:4.5 到 EdmGen

关于entity-framework - 默认目标 Entity Framework 版本需要 edmx 架构版本 2.0.0.0 或更低版本。指定的架构是版本 3.0.0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14757589/

相关文章:

linq-to-entities - 使用 edmgen.exe 时可以包含存储过程吗?

postgresql - 无法使用 .NET 4.0 在 VS10 的 EdmGen2 中显示生成的 edmx

c# - 严格使用 LLBLGen Pro 作为 EF4 的设计器

c# - EF6 Code First 从类库迁移导致空白 Up/Down

c# - 使用 Entity Framework 6 代码优先注释映射 xmltype oracle

sql-server - Entity Framework 扩展递归查询

c# - 如何在没有 EntityFramework 的情况下使用 ASP.net Core 1 "SignInManager"