Home Dashboard Directory Help

ADO.NET EntityObject Generator - Error list bug by Joao S Cardoso


 as Won't Fix Help for as Won't Fix

Sign in
to vote
Type: Bug
ID: 498723
Opened: 10/20/2009 5:28:12 AM
Access Restriction: Public
User(s) can reproduce this bug


Playing arround on an existent Class Library with a Entity Data Model, I added a new item to my project, of type ADO.NET EntityObject Generator.

I then removed the model1.tt file from my project but the following error message persists on the error list:

Error    1    Running transformation: Please overwrite the replacement token '$edmxInputFile$' with the actual name of the .edmx file you would like to generate from.    C:\_Package-NET\DAL\Model1.tt    1    1    
Sign in to post a comment.
Posted by TamusJRoyce on 3/20/2012 at 11:49 AM
Thank you Joao S Cardoso.

"Close and open the project again and the error message is gone"

This fixed my issue! Be nice if it didn't happen in the first place, but this works.
Posted by Roger Lipscombe on 5/15/2010 at 2:03 AM
I have the same problem, except that in step (d) I removed the entire model (class library) project. The error (for a project that now no longer exists is still there).
Posted by WayPoint7 on 2/19/2010 at 9:20 AM
Hi Guys!

Glad to see that you have recognized the error, sad to see that you're not going to fix it (as yet). My problem as a result of this is: my project won;t compile, because the error persists.
How do I proceed now? Do you have a workaround to get rid of the error?
Posted by Microsoft on 1/25/2010 at 2:00 PM
Hello Joao, at this time, this bug does not meet the bar for fixing. We will attempt to make the experience around code generation better in the next release.
Posted by Microsoft on 11/2/2009 at 10:40 AM
Thank you for filing this bug. We agree that it is an annoyance and will fix it as soon as we can - at this time, it does not meet the bar for Visual Studio 2010.
Posted by Joao S Cardoso on 10/23/2009 at 3:32 AM
To preproduce the error is simple. I'm sending you a screenshot of the end result also.

a) create a new class library project
b) add a new aso.net Entity Data Model
c) Add a new ado.net entityobject generator and notice the error
d) Remove the ado.net entityobject generator (.tt) file from project (delete)
e) Notice the error message is still there
f) the error message does not disapears even after a cleanup and rebuild
g) Close and open the project again and the error message is gone

Notice my screenshot. It referes to a file that its not on the project.
Posted by Microsoft on 10/21/2009 at 1:50 AM
Thanks for reporting this issue. In order to fix the issue, we must first reproduce the issue in our labs. We are unable to reproduce the issue with the steps you provided.

Please give us a demo project to demonstrate this issue so that we can conduct further research?

It would be greatly appreciated if you could provide us with that information as quickly as possible. If we do not hear back from you within 7 days, we will close this issue.

Thanks again for your efforts and we look forward to hearing from you.

Visual Studio Product Team

Sign in to post a workaround.
Posted by fiftycharacters on 4/19/2011 at 6:15 AM
Posted on blog: Diego B Vega 14 Apr 2010 5:01 AM

Something very similar happens when you add the template to your project incorrectly. Our code generation templates have been designed to be added through the “Add Code Generation Item…” Option in the Entity Data Model Designer:

When you do it this way, we automatically write the name of your EDMX file inside the TT file. But if you add the template to the project in some other way, for instance, using the standard “Add New Item” option in the Solution Explorer, the name of the EDMX file will not be written in the TT file, and instead a string replacement token will remain:

string inputFile = @"$edmxInputFile$";

When this happens, again, the exception message you get from the EntityObject generator is quite helpful:

Running transformation: Please overwrite the replacement token '$edmxInputFile
with the actual name of the .edmx file you would like to generate from.    

But unfortunately, for the POCO and the Self-Tracking Entities templates you will just get a wrapped System.IO.FileNotFoundException as in the examples above.

In any case, the solution is always the same:

open the TT file, and replace the token manually with the name or relative path to the EDMX file. Alternatively, remove the template files from the project and add them again using “Add Code Generation Item…”.


Wrapped System.IO.FileNotFoundException with Entity Framework POCO and Self-Tracking Entities T4 Templates - Diego Vega - Site Home - MSDN Blogs
Posted by gakki on 6/8/2010 at 6:13 AM
What i did to get rid of the error was the following:
I added the Model1.tt file again (right click on project, add, new item, ADO.NET EntityObjectGenerator).
Name the file Model1.tt.
Look for $edmxInputFile$ in the newly generated file and replace with C:tmp.
Build to remove the error, then delete the Model1.tt file

James Azzopardi
File Name Submitted By Submitted On File Size  
EF TT Error.jpg (restricted) 10/23/2009 -