I have a solution where Commerce were installed but never used and now we have removed it.
The problem is that now in the set access rights page in Admin we get this message:
Could not create instance of content type "SalesCampaignFolder" since it has an invalid .NET class associated: EPiServer.Commerce.Marketing.SalesCampaignFolder, EPiServer.Business.Commerce, Version=22.214.171.124, Culture=neutral, PublicKeyToken=8fe83dea738b45b7
And if I try to delete that type in admin I get this message
The content type could not be deleted since it is in use.
Are there any way to fix this without doing it directly in the database?
Time for me to shine then. Adding this code to your initialization module should fix it
var contentRootService = context.Locate.Advanced.GetInstance<ContentRootService>();
Thanks!!Great help as always!!!
Sorry, didn't work
What didn't work? Any error message?
No error message, the init module runs and gives no error but nothing is happening and the error is still there, and the folders are still there
If I try to remove it manually I get this error:
But I can not go in and manually delete that content.
You can probably try
var contentRootRepository = context.Locate.Advanced.GetInstance<ContentRootRepository>();
Hello, has a solution for this been found?
Have you tried removing the offending folders using the Manage Content feature in admin:
When I click manage content, the same error page appears unfortunately.
After trying out different solutions with Quan I endend up removing it directly from the database with SQL Script.
This solution is not supported or recommended by Episerver but for me I had to do it since the site didn't work otherway.
I run this script:
-- Remove ReportingMediaData
Delete From tblContentLanguage Where fkContentID = [ReportingMediaDataContentId]
Delete From tblWorkContent Where fkContentID = [ReportingMediaDataContentId]
Delete From tblContentAccess Where fkContentID = [ReportingMediaDataContentId]
Delete from tblContent where pkID = [ReportingMediaDataContentId]
-- Remove SalesCampaignFolder
Delete From tblContentLanguage Where fkContentID = [SalesCampaignFolderContentId]
Delete From tblWorkContent Where fkContentID = [SalesCampaignFolderContentId]
Delete From tblContentAccess Where fkContentID = [SalesCampaignFolderContentId]
Delete from tblContent where pkID = [SalesCampaignFolderContentId]
The [ReportingMediaDataContentId] and [SalesCampaignFolderContentId] I got by query the database for content by content type ReportingMediaData and SalesCampaignFolder.
As I said earlier this is a very last version of solution and if you do it you do it without support and you MUST take a backup of the database before and after you have run it you must restart the site in IIS to make Episerver remove the content types in the startup.
Thanks for the information this is very helpful.