ashcharlton
ashcharlton

Reputation: 143

Entity Framework files are not nested under the EDMX file

I know this is duplicated from Here but I also have an issue where the TT files are not nested under the edmx file. The solution from the duplicated question just puts the entity classes under the TT but not the TT under the edmx. Thanks in advance.

Upvotes: 3

Views: 1077

Answers (1)

Uba
Uba

Reputation: 669

Edit you .csproj and make sure you have "DependentUpon>Model.edmx</DependentUpon>" under <Content Include="Model.tt">. if you don't find it, add DependentUpon tag and save your .csproj file.

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

Upvotes: 7

Related Questions