Entity Framework Invalid Object Error

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 года назад
Hello,

I have a plugin that creates a couple database tables which maps nopCommerce customers to customers in our ERP. Our ERP has changed, so I uninstalled this plugin (removing the database tables) and reinstalled the plugin after changing the table and column names. Now, when I try to add a picture to a product, I get an error: InnerException = {"Invalid object name 'nop.dbo.<old_table_name>'."}. The plugin has nothing to do with modifying products, yet for some reason it is triggering this error. Any help with this problem would be greatly appreciated.

Thanks
3 года назад
Are you handling events?
In any case, it would be best if you would see if the same happens in Visual Studio, and debug it.
3 года назад
I'm not sure what you mean by 'handling events'. The same code is running on production as is in my development environment (different databases). I can place breakpoints in the code in the ProductController.cs in the ProductPictureAdd function. From there I can trace it to the InsertProductPicture function in the ProductService.cs and from there I see it in EfRepository.cs in the Insert(T entity) function. The exception is being thrown from UseNopExceptionHandler in ApplicationBuilderExtensions.cs.

For some reason at this point it says {"Invalid object name 'nop.dbo.<old_table_name>'."}. Once again, this plugin intercepts some information when creating and editing customers. It adds a couple fields to the customer edit section in order to map them to our ERP, but it has nothing to do with products. I can edit product information and SEO, but just not add a Picture. I am confused as to why this table is being referenced when trying to add a picture and really confused as to how it is still hanging on to the old table name. I have searched the entire solution and all information about the old table name has been scrubbed.
3 года назад
This has been solved. Turns out there was a database trigger the referenced the old table buried in a different database that got triggered only when a item picture was changed. No idea how that came to be, but that resolved my issue in case any future people stumble across this thread.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.