Copied to clipboard

Flag this post as spam?

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


  • Marino Simic 16 posts 53 karma points
    Aug 17, 2009 @ 15:02
    Marino Simic
    2

    Acessing the web.config in Medium trust

    When trying to install umbraco in Medium trust (yes after removing ImageManipulation Membership and forcing the provider to enable RestrictedMemberAccess permission):


    I get an error saying that the permission to use File.IO is denied while running the install step for database setup.

    Could not save the web.config file. Please modify the connection string manually. Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    This is because the following code is used to read the Web.config:


    WebConfigurationManager.OpenWebConfiguration("~")


    This code reads the web.config in the app directory and merges it with the machine Web.config (and thus requires full trust to read outside the application pool directory).

     

    I'd opt for the following code to be Medium trust compatible, since reading the machine web config is not needed:

     

    String cfgpath = Server.MapPath(@"/web.config");

    cfg = System.Configuration.ConfigurationManager.OpenExeConfiguration(cfgpath);

     

    This method opens the configuration file alone without needing full trust and accomplishing the same thing.

     

    If possible please make this changes for the next version so we (the poor ones) that are using Medium trust can configure the site online without copying configuration files from out local install.

     

    It would be very helpful if ImageGen were fixed to run in Medium trust too. It is a big drawback without it.

    If you need other info about Medium trust please contact me, I'd be glad to help solve the greates problem of all in umbraco ;)

    Thank you very much.

  • Juan P Lopez 1 post 21 karma points
    Oct 02, 2009 @ 01:07
    Juan P Lopez
    0

    Hi,

    i want to install umbraco in medium trust.. can you please give me some thoughts?

    Thanks in advance, 

    Juan

  • Niels Hartvig 1951 posts 2391 karma points c-trib
    Oct 02, 2009 @ 10:26
    Niels Hartvig
    0

    Awesome feedback!If you create a work item on codeplex I'll make sure to add this is a next version (likely to be 4.1).

    I wasn't aware that Umbraco actually worked in Medium Trust. Are you able to run XSLTs, etc. in medium trust? This would be wonderful news!

    It would be of great value of you could create a wiki page with instructions and known issues on using Umbraco with Medium Trust.

  • Ahmed 1 post 21 karma points
    Dec 16, 2009 @ 14:14
    Ahmed
    0

    Me too, I would love to know how did you install Umbraco in medium trust .. Please let us know... Thank you so much in advance

  • Jamie Howarth 306 posts 773 karma points c-trib
    Dec 22, 2009 @ 17:48
    Jamie Howarth
    1

    Hi guys,

    I've made some modifications to ImageManipulation and the umbraco.providers library and so far I seem to be running Umbraco 4 in Medium Trust on Win7 w/IIS7 (Integrated mode) fine (still yet to do thorough testing though so it's kinda "experimental" and without warranty etc. etc. blah blah). Please see here for details if you want to have a go at building yourselves.

    Hope this helps.

    Benjamin

Please Sign in or register to post replies

Write your reply to:

Draft