Copied to clipboard

Flag this post as spam?

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


  • Steven Lemmens 4 posts 74 karma points
    1 week ago
    Steven Lemmens
    1

    Possible caching error: "Umbraco.Web.PublishedModels.Image"

    Hi,

    I sometimes get the following error. Restarting my Umbraco v8 completely solves it for a while. It seems to return randomly after I have made changes to the document type of said page, so I guess it has something to do with caching ?

    The error is:

    The value "Umbraco.Web.PublishedModels.Image" is not of type "Umbraco.Web.PublishedModels.Image" and cannot be used in this generic collection.
    Parameter name: value
    

    And this is the code this error is triggered on:

    @{
       var img =  Model.Value<IPublishedContent>("boekomslag2");
     }
    

    "boekomslag2" is a property of type Media Picker, and has a real image selected.

    You can also get a similar error if you go to Media, create a new "File" and upload an image. Umbraco seems to recognize that it is indeed an image, because you can select this media item in your Media Picker, even though this proeprty is set "Pick only images". But as soon as you select your "File", it generates a very similar error.

    Any ideas ?

  • Murat 3 posts 73 karma points
    1 week ago
    Murat
    0

    I upgraded to 8.0.2 and any changed code behind it returns the same error and restart on iis solves the problem

Please Sign in or register to post replies

Write your reply to:

Draft