Bug when run in docker
Describe what is not working as expected.
If you are seeing an exception, include the full exceptions details (message and stack trace).
Exception message:
System.InvalidOperationException: Cannot create a DbSet for 'xx' because this type is not included in the model for the context.\n at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.get_EntityType()\n at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.get_EntityQueryable()
I have an Entity "CustomsInfoBase",and I define it:
public DbSet
It works find in Windows,Linux host,but when it runs in docker environment,it throw exception :
System.InvalidOperationException: Cannot create a DbSet for 'CustomsInfoBase' because this type is not included in the model for the context.
at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.get_EntityType()
at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.get_EntityQueryable()
Another entity "CustomTimeLine" it has this problem too,Now whatever entity I create, it's going to get this error, too. I have 50+ entity,So I think maybe too many entities cause memory leaks? First time I found this problem when I use Azure App Service for Windows,now I test docker from linux vm,It has the same problem.So I guess: 1.It only happen in docker(windows,linux) environments.(Fact) 2.Mass of entities.(Guess) Now I have submitted the ticket to Azure Technical support,and I push the code to them.
You mean:
public DbSet<CustomsInfoBase> CustomsInfoBase { get; set; }
@vincywindy We're going to need considerably more information that this to be able to effectively investigate. Can you have Azure support forward the repro code to us?
I found the reason is because I use Chinese words in namespace.Thanks