Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CheckoutAttribute table is not created during installation process #3321

Closed
karelkrivanek opened this issue Sep 21, 2018 · 10 comments
Closed

Comments

@karelkrivanek
Copy link

nopCommerce version: 4.10

Steps to reproduce the problem:

  1. download and install nopCommerce with sample data (also works with clean DB)
  2. add product to card - let's say a book
  3. JS error appears
    Failed to add the product. Please refresh the page and try one more time.
  4. No other page in public store can be opened because of
    System.InvalidOperationException: Cannot create a DbSet for 'CheckoutAttribute' because this type is not included in the model for the context. at Nop.Web.Framework.Infrastructure.Extensions.ApplicationBuilderExtensions.<>c.<UseNopExceptionHandler>b__1_1(HttpContext context) in C:\MojeProjekty\nopCommerce_4.10_Source\Presentation\Nop.Web.Framework\Infrastructure\Extensions\ApplicationBuilderExtensions.cs:line 83 at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

This is probably duplicate of #3213 and #3201, would a DB backup (attached) help in replicating? I tried to build it from source, download no source and no source self contained versions, my dev machine and server but every time I get the same result
wsaspokus.zip

@wwrighter
Copy link

What's the deal with the random .zip ?

@karelkrivanek
Copy link
Author

That would be the db backup

@RomanovM
Copy link
Contributor

It works correctly on our demo site, and it also works on my local machine (including the case with a new db).
Here you can see the mapping class for the checkout attribute, so this type will be included in the model for the context.

@karelkrivanek
Copy link
Author

That's great that it works on your machine, but doesn't it strike as you as odd that 3 different users created this issue? I admit, that 3 isn't that much, but still

@RomanVdV
Copy link

Same problem to me today.

@RomanVdV
Copy link

It works correctly on our demo site, and it also works on my local machine (including the case with a new db).
Here you can see the mapping class for the checkout attribute, so this type will be included in the model for the context.

Problem is in EntityFrameworkCorre, it depends on language settings and sorting, I tryed it. More info here Entity type name is culture-sensitive. I am new to nopcommerce, but I think, that you can done quick fix, before bug will be fixed in EFC.

@RomanovM RomanovM reopened this Oct 1, 2018
@RomanovM RomanovM changed the title Product can't be added to cart/checkout attribute can't be edited in admin CheckoutAttribute table is not created during installation process Oct 1, 2018
@zwierzyna-prosystem
Copy link

I think CheckoutAttribute table si created correctly, but I found, that if you put
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US") before TaskManager.Instance.Initialize() at line 66 in class ServiceCollectionExtensions and function ConfigureApplicationServices, website seems to start working.

@zwierzyna-prosystem
Copy link

zwierzyna-prosystem commented Dec 4, 2018

Today i tried to migrate whole NopCommerce project to .Net Core 2.2 preview 3, installed last Microsoft.EntityFrameworkCore.SqlServer 2.2.0 NuGet and it looks like, that problems disappeared ...

@kocmour
Copy link

kocmour commented Mar 13, 2019

After some investigation...
You can reproduce this problem by set the different culture then "en-Us" for working environment . Simply set different culture in CultureMiddleware class in SetWorkingCulture method (I use cs-CZ).
Once you go to "Administration" culture is via CultureMiddleware hardcoded to "en-US" by. CommonHelper.SetTelerikCulture() some "hack due to telerik" and this seems to be "in some cases and I don´t know how to determine them" problem when getting Table from Datacontext. Seems like model for table are culture sensitive..?

@RomanovM RomanovM added this to the Version 4.20 milestone May 13, 2019
@skoshelev
Copy link
Contributor

Can't reproduce on 4.20. Closed #3321

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants