I'm creating a Console Project in VS2012 with .Net4.5. After it I "Add", "New Item" to the project, and choose "EF 5.x DbContext Generator". Then, after a couple of seconds the following error message appears in the 'Error List' tab:
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:\Projects\Tests\ConsoleAppEF5\ConsoleAppEF5\Model1.tt`
How can I fix this ?
What am I missing ?
You should create edmx model first to generate POCO's from it automatically. You can add it through menu (Add New Item -> ADO.NET Entity Data Model). After the model will be created you can use the DbContext generator. Replace $edmxInputFile$ with the name of your edmx file and then save file you are edit (though VS 2012 should do it automatically).
And in another scenario, this is apparently a known bug: http://web.archive.org/web/20131203074519/http://connect.microsoft.com/VisualStudio/feedback/details/498723/ado-net-entityobject-generator-error-list-bug
So if you add a DbContext Generator and then remove it and you get this error, just close and reopen the project. Solved it for me.
In my case I was inadvertently adding the EF Db Context Generator
instead of Entity Framework
. Total PEBKAC
but I'm posting it here as I'm sure I will not be the only one.
I noticed that the file extension was TT
as this is a text template not the EDMX
that I wanted.
If you are looking to add entity then add ADO.NET Entity Data Model
not EF X.x DbContext Generator
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With