Hello,
I am having another problem with modifying database. In my case, I only get this error with the Customer table. This is my step to reproduce the error
1. Add one table in database, name ksu_Banner. This table has some fields: BannerID, Name, CreatedBy, CreatedDate
2. Create a relationship between CreatedBy and CustomerId in Customer table
3. Open edmx file, update changes from database and select new table
4. Delete the navigation property in Customer and Banner in edmx file
5. Create a class in Extension folder for new table
6. Build solution
7. Try to register new member, and i have this error
The changes to the database were committed successfully, but an error occurred while updating the object context. The ObjectContext might be in an inconsistent state. Inner exception message: There is no metadata information available for the proxy type for 'NopSolutions.NopCommerce.BusinessLogic.CustomerManagement.Customer'. This exception can be caused when a proxy type for an entity is detached from an ObjectContext. See InnerException for details.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The changes to the database were committed successfully, but an error occurred while updating the object context. The ObjectContext might be in an inconsistent state. Inner exception message: There is no metadata information available for the proxy type for 'NopSolutions.NopCommerce.BusinessLogic.CustomerManagement.Customer'. This exception can be caused when a proxy type for an entity is detached from an ObjectContext. See InnerException for details.
Source Error:
Line 1233:
Line 1234: _context.Customers.AddObject(customer);
Line 1235: _context.SaveChanges();
Line 1236:
Line 1237: //reward points
Source File: D:\WORK\NOPCOMMERCE\nopCommerce_1.90_Source\Libraries\Nop.BusinessLogic\Customer\CustomerService.cs Line: 1235
Stack Trace:
[InvalidOperationException: The changes to the database were committed successfully, but an error occurred while updating the object context. The ObjectContext might be in an inconsistent state. Inner exception message: There is no metadata information available for the proxy type for 'NopSolutions.NopCommerce.BusinessLogic.CustomerManagement.Customer'. This exception can be caused when a proxy type for an entity is detached from an ObjectContext. See InnerException for details.]
System.Data.Objects.ObjectContext.SaveChanges(SaveOptions options) +779
System.Data.Objects.ObjectContext.SaveChanges() +15
NopSolutions.NopCommerce.BusinessLogic.CustomerManagement.CustomerService.AddCustomerForced(Guid customerGuid, String email, String username, String passwordHash, String saltKey, Int32 affiliateId, Int32 billingAddressId, Int32 shippingAddressId, Int32 lastPaymentMethodId, String lastAppliedCouponCode, String giftCardCouponCodes, String checkoutAttributes, Int32 languageId, Int32 currencyId, TaxDisplayTypeEnum taxDisplayType, Boolean isTaxExempt, Boolean isAdmin, Boolean isGuest, Boolean isForumModerator, Int32 totalForumPosts, String signature, String adminComment, Boolean active, Boolean deleted, DateTime registrationDate, String timeZoneId, Int32 avatarId, Nullable`1 dateOfBirth) in D:\WORK\NOPCOMMERCE\nopCommerce_1.90_Source\Libraries\Nop.BusinessLogic\Customer\CustomerService.cs:1235
NopSolutions.NopCommerce.BusinessLogic.CustomerManagement.CustomerService.AddCustomer(Guid customerGuid, String email, String username, String password, Int32 affiliateId, Int32 billingAddressId, Int32 shippingAddressId, Int32 lastPaymentMethodId, String lastAppliedCouponCode, String giftCardCouponCodes, String checkoutAttributes, Int32 languageId, Int32 currencyId, TaxDisplayTypeEnum taxDisplayType, Boolean isTaxExempt, Boolean isAdmin, Boolean isGuest, Boolean isForumModerator, Int32 totalForumPosts, String signature, String adminComment, Boolean active, Boolean deleted, DateTime registrationDate, String timeZoneId, Int32 avatarId, Nullable`1 dateOfBirth, MembershipCreateStatus& status) in D:\WORK\NOPCOMMERCE\nopCommerce_1.90_Source\Libraries\Nop.BusinessLogic\Customer\CustomerService.cs:1102
NopSolutions.NopCommerce.BusinessLogic.CustomerManagement.CustomerService.AddCustomer(String email, String username, String password, Boolean isAdmin, Boolean isGuest, Boolean active, MembershipCreateStatus& status) in D:\WORK\NOPCOMMERCE\nopCommerce_1.90_Source\Libraries\Nop.BusinessLogic\Customer\CustomerService.cs:938
NopSolutions.NopCommerce.BusinessLogic.Profile.StoreMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) in D:\WORK\NOPCOMMERCE\nopCommerce_1.90_Source\Libraries\Nop.BusinessLogic\Profile\StoreMembershipProvider.cs:101
System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +302
System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) +111
System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +413
System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) +121
System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) +19
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +125
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +167
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
I only have this error with the Customer table. I do same way with Product table (i.e create a new table and have productID as a foreign key) but I don't have error when adding new Product table.
Please help me to fix this issue.
thank you very much.