title: Umbraco razor macro DynamicPublishedContentList does not contain a definition for
body: <p>My umbraco view has generated the following code for a macro that works fine:</p>
  
  <pre><code>@* Helper method to travers through all descendants *@
  @helper Traverse(dynamic node)
  {
      @* Update the level to reflect how deep you want the sitemap to go *@
      var maxLevelForSitemap = 5;
  
      @* Select visible children *@
      var selection = node.Children.Where("Visible").Where("Level &lt;= " + maxLevelForSitemap);
  
      @* If any items are returned, render a list *@
      if (selection.Any())
      {
          &lt;ul&gt;
              @foreach (var page in selection)
              {
                  &lt;li class="level-@page.Level @(page.IsAncestorOrSelf(CurrentPage) ? "on" : null)"&gt;
                      @if (page.isNotNavigable == true)
                      {
                          &lt;span&gt;
                              &lt;cite class="arrow"&gt;&lt;/cite&gt;@page.Name
                          &lt;/span&gt;
                      }
                      //if next line fails, add before the if below: page.HasProperty("pageRedirectTarget")
                      else if (page.HasValue("pageRedirectTarget"))
                      {
                          var redirectPage = Umbraco.Content(page.pageRedirectTarget);
                          &lt;a href="@redirectPage.Url.Substring(0, redirectPage.Url.Length - 1)@page.pageRedirectComplement"&gt;
                              &lt;cite class="arrow"&gt;&lt;/cite&gt;@page.Name
                          &lt;/a&gt;
                      }
                      else
                      {
                          &lt;a href="@page.Url"&gt;
                              &lt;cite class="arrow"&gt;&lt;/cite&gt;@page.Name
                          &lt;/a&gt;
                      }
  
                      @* Run the traverse helper again for any child pages *@
                      @Traverse(page)
                  &lt;/li&gt;
              }
          &lt;/ul&gt;
      }
  }
  </code></pre>
  
  <p>The problem happens when I added another dll (compiled in 3.5 framework) and the <strong>selection.Any()</strong> stop working, instead gives an error saying "does not contain a definition for Any()".</p>
  
  <p>I know that dynamic doens't support extension methods but why does it work without me adding the reference and with it gives the error?</p>
  
  <p>Can anyone help me?</p>
  
  <p>thanks.</p>