Error Loading Razor Script (file: uBlogsy - Show RSS Link) Sequence contains no elements at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source) at ASP._Page_macroScripts_uBlogsyShowRSSLink_cshtml.Execute() in d:\inetpub\vhosts\dotraining.co.uk\httpdocs\macroScripts\uBlogsyShowRSSLink.cshtml:line 10 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors) at System.Web.WebPages.WebPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage) at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)
Thanks for pointing out to d right direction, I followed your instructions and now i can see the rss subscribe button on the website but when i click on it , it takes me to xml version, is that what it suppose to do. the link is
Waz using Using Version 1.35 (stable release) just updated to 1.3.5.1 , i am not taking any risks of updating to the latest one , the tree is like:
Articles
1)Blog
1.1)General
1.1.1)Practice what you preach
Comment
1.2)Basketball posts
1.2.1) 7 dunks
Comments
2)Rss
And for Rss feed to work should i have to connect to some third party rss feeds , I am completley new to RSS , i disabled the rss from the website but my client want to include rss , as when he add any blog , the subscribers will be able to know that the new post is added, something like this.
Error loading Razor Script uBlogsyShowRSSLink.cshtml
Using Version 1.35 (stable release)
Umbraco Version : umbraco v 4.7.0 (Assembly version: 1.0.4090.21631)
The blog is working fine but the rss feeds is not working when i uncomment the below line in uBlogsyBaseSite
<%--rss link--%>
<!-- <umbraco:Macro ID="Macro4" Alias="uBlogsyShowRSSLink" runat="server" /> -->
On the blog page it comes up with error :
Error loading Razor Script uBlogsyShowRSSLink.cshtmlSequence contains no elements
Any ideas how to fix this
Stack Trace Error:
at ASP._Page_macroScripts_uBlogsyShowRSSLink_cshtml.Execute() in d:\inetpub\vhosts\dotraining.co.uk\httpdocs\macroScripts\uBlogsyShowRSSLink.cshtml:line 10
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors)
at System.Web.WebPages.WebPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage)
at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)
The error is "Sequence contains no elements "
The line is :
var rss = landing.GetChildrenAsList.Items.Where(x => x.NodeTypeAlias =="uBlogsyRSS").Single();
.Single() MUST return something. In this case we're looking for a node with nodeTypeAlias == uBlogsyRSS, which is a direct child of the landing node.
Check that there is a uBlogsyRSS node under landing as a child (not a grandchild)
Thanks for pointing out to d right direction, I followed your instructions and now i can see the rss subscribe button on the website but when i click on it , it takes me to xml version, is that what it suppose to do. the link is
http://www.dotraining.co.uk/articles
That is exactly what is meant to happen.
I noticed the links to your pages have an extra /articles/
What version of uBlogsy are you using?
Waz using Using Version 1.35 (stable release) just updated to 1.3.5.1 , i am not taking any risks of updating to the latest one , the tree is like:
Articles
1)Blog
1.1)General
1.1.1)Practice what you preach
Comment
1.2)Basketball posts
1.2.1) 7 dunks
Comments
2)Rss
And for Rss feed to work should i have to connect to some third party rss feeds , I am completley new to RSS , i disabled the rss from the website but my client want to include rss , as when he add any blog , the subscribers will be able to know that the new post is added, something like this.
Just a quick fix:
Replace
string blogUrl = Request.Url.AbsoluteUri.Replace("/rss", string.Empty).TrimEnd("/".ToCharArray());
with
string blogUrl = Request.Url.AbsoluteUri.Replace("/rss/articles", string.Empty).TrimEnd("/".ToCharArray());
Thanks , well i replaced the blogUrl with the one u mentioned above but the links generated doesnt works : its like
http://www.dotraining.co.uk/articles/rss/articles/blog/basketball-posts/guada-highlights/
Oops
My mistake. Replace the whole thing with these 2 lines
string blogUrl = Request.Url.AbsoluteUri.Replace("/rss", string.Empty).TrimEnd("/".ToCharArray());
blogUrl = blogUrl.Replace("/article/article", "/article");
well when i click on the link of my post using google rss reader it takes me too :
http://www.dotraining.co.uk/articles/rss/articles/blog/basketball-posts/guada-highlights/
instead of:
http://www.dotraining.co.uk/articles/blog/basketball-posts/guada-highlights/
I guess this is not replacing :
blogUrl = blogUrl.Replace("/articles/articles", "/articles");
it worked when i duplicated the code :
string blogUrl= Request.Url.AbsoluteUri.Replace("/rss", string.Empty).TrimEnd("/".ToCharArray());
blogUrl = Request.Url.AbsoluteUri.Replace("/articles/articles", string.Empty).TrimEnd("/articles".ToCharArray());
is working on a reply...