Search code examples
c#umbracoumbraco7

Preview mode reads from old dll


I have changed my DocumentType Alias from authenticateWithNemid to authenticateToCreateProposal and changed the code related to that and of course my modelsBuilder's model (Dll mode). Everything works fine on the page for the viewers but when I try to preview it, I get an error saying:

ContentTypeService failed to find a content type with alias "authenticateWithNemid" (old value) .. This usually indicates that the content cache is corrupt; the content cache has been rebuilt in an attempt to self-fix the issue.

But then shows me the line of code that I've tried to access it in my c# heper class.

public static IPublishedContent AuthenticateWithNemidPage => 
CreateProposalPage.FirstChild(c =>
 c.IsDocumentType("authenticateToCreateProposal"));//(new value)

How is this even possible?! what is going on?!

enter image description here

P.S: I don't think it is related since it tries to read the wrong value, but since it indicates in the error I have deleted umbraco.config and republished the whole site again and well it didn't help.


Solution

  • :O I've found the problem. As I've mentioned in the description, I've changed the document type names and apparently the content of the page still thinks that it is from the old type but then it cannot find it in the preview mode.

    How did I found it?

    I tried to read the data part by part so maybe I could find the part that throws the exception. So I wrote:

    var x=CreateProposalPage.Children();
    

    And I've got the same error. So I tried publishing the child pages and then the problem has been fixed!

    I'm also kinda surprised since I've deleted the Umbraco.config and also republished the whole website. But apparently The republishing is not doing what you would expect