【问题标题】:Entity Framework files are not nested under the EDMX file实体框架文件不嵌套在 EDMX 文件下
【发布时间】:2015-05-21 15:54:01
【问题描述】:

我知道这是从 Here 复制的,但我也有一个问题,即 TT 文件没有嵌套在 edmx 文件下。重复问题的解决方案只是将实体类放在 TT 下,而不是将 TT 放在 edmx 下。提前致谢。

【问题讨论】:

标签: c# asp.net-mvc entity-framework t4 edmx


【解决方案1】:

编辑您的 .csproj 并确保您在 <Content Include="Model.tt"> 下有 "DependentUpon>Model.edmx</DependentUpon>"。如果找不到,请添加 DependentUpon 标记并保存您的 .csproj 文件。

<Content Include="Model.tt">
  <Generator>TextTemplatingFileGenerator</Generator>
  <DependentUpon>Model.edmx</DependentUpon>
  <LastGenOutput>Model.cs</LastGenOutput>
</Content>

【讨论】:

  • 非常感谢。这给我带来了整个下午的问题。我什至浏览了项目文件并看到了这些行,但没有尝试编辑它们。谢谢。
猜你喜欢
  • 1970-01-01
  • 2011-04-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-07-06
  • 2012-04-06
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多