Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Qamar Ali 34 posts 165 karma points
    Nov 05, 2018 @ 02:50
    Qamar Ali
    0

    Sequence contains no elements

    Hi, I am using Umbraco version 7.12.2 and an Umbraco starter kit from uskinned.net. My project was running fine. I restarted my website from Visual Studio and now I am getting this error enter image description here

    Please help me.

    Qamar

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Nov 05, 2018 @ 08:52
    Alex Skrypnyk
    0

    Hi Qamar

    It looks like "websiteConfigurationNode" is missed from the tree. Can you check that "websiteConfigurationNode" is accessible in Umbraco backend?

    Alex

  • Mads Krohn 211 posts 504 karma points c-trib
    Nov 05, 2018 @ 09:07
    Mads Krohn
    1

    The error stems from .First() not returning any results because .Where() doesn't return any results. So it's not the websiteConfigurationNode that is missing, the node just doesn't have any children with the alias USNNavigation. I would assume it's because of a spelling error, perhaps it should have been USNavigation, without the extra 'N'?

  • Qamar Ali 34 posts 165 karma points
    Nov 05, 2018 @ 14:44
    Qamar Ali
    0

    No its USNNavigation, I am using starter kits from uskinned.net and this part of the code comes with the starter kit. I did not make any changes here.

  • Mads Krohn 211 posts 504 karma points c-trib
    Nov 05, 2018 @ 14:49
    Mads Krohn
    0

    Ok, but regardless, you get an error because the .Where clause returns an empty sequence.

  • Qamar Ali 34 posts 165 karma points
    Nov 05, 2018 @ 14:50
    Qamar Ali
    0

    so what should I do, should I change the umbraco version or repair my visual studio ?

  • Mads Krohn 211 posts 504 karma points c-trib
    Nov 05, 2018 @ 15:12
    Mads Krohn
    100

    No, this is purely an issue regarding content on your site.

    So, on the Home node on your site, it seems there is a property called websiteConfigurationNode, that is a content picker, where you should have picked a configuration node.

    That configuration node is supposed to have some children, according to the code -> .Children.Where(...) However, none of those children is apparently of document type "USNNavigation", so you get an empty list, and .First() will then throw an error. So, you need to check the configuration node for children of that document type. If they actually do exist, try republishing them.

  • Qamar Ali 34 posts 165 karma points
    Nov 05, 2018 @ 16:20
    Qamar Ali
    0

    Thanks alot. It worked.

  • Mads Krohn 211 posts 504 karma points c-trib
    Nov 05, 2018 @ 19:30
    Mads Krohn
    0

    Great to hear :)

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Nov 05, 2018 @ 10:33
    Alex Skrypnyk
    0

    Hi Mads

    Exactly, you are right.

Please Sign in or register to post replies

Write your reply to:

Draft