efcore icon indicating copy to clipboard operation
efcore copied to clipboard

Bug when run in docker

Open vincywindy opened this issue 8 years ago • 3 comments

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 CustomsInfoBase { get; set; }

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.

vincywindy avatar Oct 21 '18 09:10 vincywindy

You mean:

public DbSet<CustomsInfoBase> CustomsInfoBase { get; set; }

igoventura avatar Oct 22 '18 18:10 igoventura

@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?

ajcvickers avatar Oct 22 '18 19:10 ajcvickers

I found the reason is because I use Chinese words in namespace.Thanks

vincywindy avatar Oct 23 '18 06:10 vincywindy