Nettiers and tables that refuse to generate an entity

When you generate the code one or more entities are missing. There is no error message.

Besides the entity/entities not showing up you see it in the SourceTables property of nettiers. When you started the template all were marked. When the template was finished one/more table/s were not marked any more.

Reason: the tables are missing a primary key.

I have spent hours on this before. I did it again. Hopefully this post will make me, and others, spend less time on this issue.