Copied to clipboard

Flag this post as spam?

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


  • Niklas Hjelm 104 posts 125 karma points
    Jan 01, 2011 @ 13:49
    Niklas Hjelm
    0

    Security Exception Umbraco 4.5.2

    I'm getting the following problem when trying to render a image with Imagegen. Using the 2.2 update for Imagegen and Umbraco 4.5.2.

    Security Exception

    Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

    Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    I don't have medium trust set in my web.config. 

    My XSLT file looks like this:

          <img>
            <xsl:attribute name="src">
                <xsl:text>/umbraco/ImageGen.ashx?image=</xsl:text>
                <xsl:value-of select="$mediaNode/umbracoFile" />

                <xsl:text>&amp;width=520</xsl:text>
                <xsl:text>&amp;compression=80</xsl:text>
                <xsl:text>&amp;constrain=true</xsl:text>
                </xsl:attribute>
        </img>

    What could be the cause of this?

    Thanks

    / Niklas

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 01, 2011 @ 17:10
    Douglas Robar
    0

    ImageGen is not (yet) medium-trust capable. It needs at least high trust and preferably full trust.

    cheers,
    doug.

  • Niklas Hjelm 104 posts 125 karma points
    Jan 01, 2011 @ 17:37
    Niklas Hjelm
    0

    Hi Doug

    Thanks for your reply. That's the thing. I don't have medium trust set in my web.config. Haven't done any changes at all and from what I've read full trust is default. Any ideas what I can look for?

    / Niklas

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 01, 2011 @ 17:54
    Douglas Robar
    0

    ImageGen is going to create a 'cached' folder below the image you are trying to resize (probably in the /media folder but also the /data and /app_data folders). Perhaps the application pool owner does not have create/read/update/delete permission to those areas?

    You might find that the host has set machine-wide trust levels as well, or created a custom trust environment. Or are you hosting this site yourself?

    cheers,
    doug.

  • Niklas Hjelm 104 posts 125 karma points
    Jan 01, 2011 @ 18:14
    Niklas Hjelm
    0

    Hi, right now I'm in development so I'm running it on localhost. The strange thing is that I've used Imagegen in other projects and have never encountered this problem before. What kind of security settings should I allow?

    Thanks

    / Niklas

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Jan 02, 2011 @ 13:29
    Sebastiaan Janssen
    0

    Hey Niklas, if it doesn't work on the same machine, I would look at differences in your web.config files. Have a look at a web.config from a project that does work and compare it with something like winmerge to your current project's web.config. Also make sure the sites / application pools are configured similarly in IIS.

  • Dean 55 posts 98 karma points
    Jan 25, 2011 @ 04:05
    Dean
    0

    Hello Doug,

    Firstly, thanks heaps for your imagegen solution. It is brilliant and I've used on a few of my sites.

    Which is why I now have a little problem. I really have to make them work in medium trust, so I was wondering if there is an update on when v3.0 may be coming?

    I also must make the decision whether to use imagegen for the current project i'm working on or not, and I would really really like to as like I said it is brilliant.

    If it is not coming soon, do you have some suggestion on what would be a good alternative solution, I only need the thumbnail generation functionality.

    Thanks

    Dean

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 25, 2011 @ 09:30
    Douglas Robar
    0

    Hi, Dean,

    Thanks for the kind words; I'm glad you find ImageGen so helpful! Unfortunately, medium trust support is still some time away. I have an update (v2.5) coming soon that has everything short of medium trust support. Perhaps you can get a custom trust level and still use ImageGen?

    cheers,
    doug.

Please Sign in or register to post replies

Write your reply to:

Draft