Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6576915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:34:14+00:00 2026-05-25T15:34:14+00:00

I have an Entity Framework model with the Entity Objects T4 Template. For some

  • 0

I have an Entity Framework model with the Entity Objects T4 Template. For some reason, now every time I change the model (say the model name is Model.edmx and the template Model.tt), it used to update the Model.cs file, but now it’s creating Model1.cs and leaving Model.cs untouched.

Why is that? Where does it define the file to update or gen to?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:34:15+00:00Added an answer on May 25, 2026 at 3:34 pm

    This sometimes happens when there’s already a file named “Model.cs” in the output directory. Visual Studio then generates to another file named “Model1.cs”. The way to fix that is by unloading the project file (right click the project) and edit it (right click again). Look for something like this:

    <ItemGroup>
       <Compile Include="Model1.cs">
          <AutoGen>True</AutoGen>
          <DesignTime>True</DesignTime>
          <DependentUpon>Model.tt</DependentUpon>
       </Compile>
    </ItemGroup>
    <ItemGroup>
       <None Include="Model.tt">
          <Generator>TextTemplatingFileGenerator</Generator>
          <LastGenOutput>Model1.cs</LastGenOutput>
       </None>
    </ItemGroup>
    

    Replace “Model1.cs” with “Model.cs”

    <ItemGroup>
       <Compile Include="Model.cs">
          <AutoGen>True</AutoGen>
          <DesignTime>True</DesignTime>
          <DependentUpon>Model.tt</DependentUpon>
       </Compile>
    </ItemGroup>
    <ItemGroup>
       <None Include="Model.tt">
          <Generator>TextTemplatingFileGenerator</Generator>
          <LastGenOutput>Model.cs</LastGenOutput>
       </None>
    </ItemGroup>
    

    Reload project (right click)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an entity framework model with has some inheritance in it. The following
I have an Entity Framework data model. Part of the model is a Customer
I have created a Dynamic Data site against an Entity Framework Model I have
I'm working with a small model in Entity Framework 4.0. I'd like to have
I have converted an Entity framework project to use POCO objects by removing the
I have got an Entity model which contains a collection of Message objects which
I have a model library (namespace Test.App.Model.EF ) with the Entity Framework implementation in
Now that I have built a database. Visual Studio 2008 SP1’s ADO.NET Entity Framework
I am using MVC3 with Entity Framework Code First. I have the following model.
I have an MVC3 project using the Entity Framework model in which I've marked

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.