Search code examples
entity-frameworkentity-framework-4pocoefpocoadapter

The type or namespace name 'FixupCollection' could not be found


I generated POCO's using the EF POCO template. When I build my project, it tells me that I am missing a reference to the FixupCollection. Which library reference am I missing?

Here's the error: The type or namespace name 'FixupCollection' could not be found (are you missing a using directive or an assembly reference?)


Solution

  • I re-ran the template tool to re-generate the model classes and the problem went away.

    I saw that the problem occurred because (I don't know how) I had accidentally deleted the code that defines the FixupCollection<T> class that gets generated by the template tool. This code is generated and shows up in the YourModelName.cs file under YourModelName.tt in the Solutions Explorer.

    I am answering my own question because I was held up for a few hours on this and I Googled but couldn't find a single link that provided help on this topic. There were only a handful of other links all asking this same question but no answer.