Copied to clipboard

Flag this post as spam?

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


  • Mohammad Javed 64 posts 373 karma points
    Nov 13, 2015 @ 10:42
    Mohammad Javed
    0

    The call is ambiguous between the following methods or properties....

    Hello,

    I'm getting an error on a site i have developed, it works locally but i've just published it to the server (vidahost)

    The call is ambiguous between the following methods or properties:

    'Umbraco.Web.UmbracoHelper.TypedMedia(params int[])' and 'Umbraco.Web.UmbracoHelper.TypedMedia(params string[])'

    Stack error;

    Server Error in '/' Application.
    
    The call is ambiguous between the following methods or properties: 'Umbraco.Web.UmbracoHelper.TypedMedia(params int[])' and 'Umbraco.Web.UmbracoHelper.TypedMedia(params string[])'
    
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    
    Exception Details: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: The call is ambiguous between the following methods or properties: 'Umbraco.Web.UmbracoHelper.TypedMedia(params int[])' and 'Umbraco.Web.UmbracoHelper.TypedMedia(params string[])'
    
    Source Error: 
    
    
    Line 25:             <span class="date">
    Line 26:                 <i class="fa fa-calendar"></i>
    Line 27:                     @CurrentPage.CreateDate.ToString("dd-MM-yyyy")
    Line 28:             </span> 
    Line 29:             <span class="author">
    
    Source File: \\sambal\sites\liquidthinker.com\public_html\Views\Article.cshtml    Line: 27 
    
    Stack Trace: 
    
    
    [RuntimeBinderException: The call is ambiguous between the following methods or properties: 'Umbraco.Web.UmbracoHelper.TypedMedia(params int[])' and 'Umbraco.Web.UmbracoHelper.TypedMedia(params string[])']
       CallSite.Target(Closure , CallSite , UmbracoHelper , Object ) +248
       ASP._Page_Views_Article_cshtml.Execute() in \\sambal\sites\liquidthinker.com\public_html\Views\Article.cshtml:27
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +280
       System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +126
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +110
       Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +140
       System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +380
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +109
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +890
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +890
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +97
       System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +241
       System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
       System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +19
       System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +51
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
    
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34248
    

    This is the Article.cshtml view;

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @{
        Layout = "Root.cshtml";
    }
    
    <!-- Article Template -->
    <section class="article">
    
        <div class="medium-8 large-8 columns noPaddingLeft border-right left-side-content">
    
            @if (!String.IsNullOrEmpty(CurrentPage.customTitle))
            {
                <h1 class="pageTitle">
                    @CurrentPage.customTitle
                </h1>
            }
            else
            {
                <h1 class="pageTitle">
                    @CurrentPage.Name
                </h1>
            }
    
            <div class="blogPostInfo large-12 columns noPadding">
                <span class="date">
                    <i class="fa fa-calendar"></i>
                        @CurrentPage.CreateDate.ToString("dd-MM-yyyy")
                </span> 
                <span class="author">
                    <i class="fa fa-pencil"></i>
                        Damian Hughes
                </span>
                <span class="comments">
                    <i class="fa fa-comment"></i>
                        <a href="@CurrentPage.Url#disqus_thread">0 comments</a>
                </span>                        
            </div>
    
            <div class="clearfix"></div>
    
    
            <div class="fullWidthImage large-12">
                <img class="img-thumbnail full" src="@Umbraco.TypedMedia(CurrentPage.blogFullImage).Url" alt="@Umbraco.TypedMedia(CurrentPage.blogFullImage).Name" />            
            </div>
    
    
            <div class="blogContent">
                @CurrentPage.blogContent
            </div>
    
            <div class="socialShare large-12">
                <!-- Go to www.addthis.com/dashboard to customize your tools -->
                <div class="addthis_sharing_toolbox"></div>
            </div>
    
            <div class="disqusContainer large-12 columns noPadding">
                <div id="disqus_thread"></div>
                    <script>
                        /**
                         *  RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
                         *  LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables
                         */
                        /*
                        var disqus_config = function () {
                            this.page.url = PAGE_URL;  // Replace PAGE_URL with your page's canonical URL variable
                            this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
                        };
                        */
                        (function() {  // DON'T EDIT BELOW THIS LINE
                            var d = document, s = d.createElement('script');
    
                            s.src = '//liquidthinker.disqus.com/embed.js';
    
                            s.setAttribute('data-timestamp', +new Date());
                            (d.head || d.body).appendChild(s);
                        })();
                    </script>
                    <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
            </div>
    
            <div class="clearfix"></div>
        </div>
    
        <div class="medium-4 large-4 columns" id="booksSideMenu">
            @Umbraco.RenderMacro("BooksRightSideMenu")
        </div>
    
    </section>
    

    Can't quite see why it would error, what am I missing?

    Kind Regards

    Javed

  • Mohammad Javed 64 posts 373 karma points
    Nov 16, 2015 @ 15:11
    Mohammad Javed
    100

    Hello,

    The problem here was that the doc type blog full image didn't have an image uploaded hence the error.

    I need to wrap the image with an if statement to resolve it.

    Thanks

    /Javed

Please Sign in or register to post replies

Write your reply to:

Draft