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:
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 ;)
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.
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.
Hi,
i want to install umbraco in medium trust.. can you please give me some thoughts?
Thanks in advance,
Juan
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.
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
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
is working on a reply...