【问题标题】:Visual Studio - Default code generation is disabledVisual Studio - 默认代码生成已禁用
【发布时间】:2014-05-19 19:19:00
【问题描述】:

我正在尝试学习使用实体数据模型的本教程。
http://www.entityframeworktutorial.net/create-first-simple-EDM.aspx
它告诉我打开 Model1.designer.cs 文件。
我应该看到一堆 C# 代码,但我看到的只是:

// Default code generation is disabled for model 'c:\users\dewi jones\documents\visual studio 2012\Projects\dewi_test\dewi_test\Dewi_Model.edmx'. 
// To enable default code generation, change the value of the 'Code Generation Strategy' designer
// property to an alternate value. This property is available in the Properties Window when the model is
// open in the designer.

我尝试启用代码生成,但不知道如何启用。我在项目属性中看不到它:( 我是 Visual Basic 的新手,非常感谢帮助。谢谢

【问题讨论】:

    标签: c# entity-framework visual-studio-2012 entity-framework-4


    【解决方案1】:

    在 Visual Studio 中打开实体模型的Model Browser Window,导航到“属性”窗口(点击[F4])并将Code Generation Strategy 更改为Default

    【讨论】:

    • 非常感谢。但它仍然只是显示大量推荐而没有代码:(有什么方法可以生成代码?谢谢
    • 更改生成模板后你的模型保存了吗?使用的代码生成模板是什么?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-01-05
    • 1970-01-01
    • 1970-01-01
    • 2023-01-01
    • 1970-01-01
    • 2020-10-19
    • 1970-01-01
    相关资源
    最近更新 更多