Copied to clipboard

Flag this post as spam?

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


  • Dan 1288 posts 3921 karma points c-trib
    Jan 03, 2022 @ 14:40
    Dan
    0

    Error getting Media URL in Tag Helper

    I'm exploring Tag Helpers in v9 using https://github.com/umbraco-community/Our-Umbraco-TagHelpers as a reference. Specifically, just trying to get the InlineSvgTagHelper to work, which I can then modify for my own use-case. It's set up and intellisense in VS for the new tag is working, so it's working to an extent. However, I'm getting an error on MediaItem.Url() on line 62. It's saying:

    There is no argument given that corresponds to the required formal parameter 'publishedUrlProvider' of 'PublishedContentExtensions.Url(IPublishedContent, IPublishedUrlProvider, string, UrlMode)'
    

    Does anyone know how to resolve this?

    Many thanks for any pointers.

  • Dan 1288 posts 3921 karma points c-trib
    Jan 06, 2022 @ 08:55
    Dan
    100

    Thanks to Warren Buckley on Discord, this has been resolved now. It was a case of a missing dependency. Installed Umbraco.Cms.Web.Common via Nuget and the .Url() method now works as expected.

Please Sign in or register to post replies

Write your reply to:

Draft