I have a problem installing Umbraco in a medium trust envirionment (Loopia Sweden). I get an error message complaining about ReflectionPermissions.
As I understand Umbraco 4.5.2 should run in medium trust, right?
What I did was:
Change setting umbracoUseMediumTrust to true
I couldn't uncomment <trust level="Medium" originUrl=".*" /> because overriding the trust level is not allowed
Added <identity impersonate="true" /> because I read somewhere that you were supposed to do this (although it's the same without it)
There seems something is happening because when accessing default.aspx I get redirected to /install/default.aspx?redir=true&url=/default.aspx
But with error message:
Server Error in '/' Application.
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.Security.Permissions.ReflectionPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed.
Source Error:
An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
Have a look at this post, at the answer from Ben H that's marked as the solution. He mentions some setting that you might need to change, does doing that sort out the problem?
Unfortunately requirePermission is already set to false in the Umbraco 4.5.2 for .NET 3.5 release so that doesn't help. Forgot to say that i Use .NET 3.5.
I talked to the provider and they say that Umbraco demands support for reflection, which they do not support. But to my knowledge reflection is part of the Medium Trust by default, so Umbraco should support that if it supports Medium trust?
Medium trust isn't a problem with Umbraco 4.5.2, though many hosts run in a custom trust environment based on medium trust (perhaps that's true of your host?).
In any event, not all packages are medium-trust friendly. My ImageGen package, for instance, is not yet medium trust capable.
When do you get the errors, when visiting the website itself, logging into umbraco, viewing a specific page in the Umbraco admin interface, ???
Another option - copy the site locally and set IIS to medium trust. Does it work then? If so then it is a setting with your host and not Umbraco.
What @Doug said. Although the host may support medium trust, they may customise the bits they do and don't support. I know a few hosts that won't let you use reflection, so it might just be that they're running a version of medium trust with reflection disabled. Try setting up a site in medium trusty locally as Doug suggests, and if that works, its definitely the host.
According to my provider they are running Medium Trust and they are allowing:
OleDbPermission
OdbcPermission
WebPermission
file access to the ftp folder
SocketPermission
A version of Connector.Net
I believe just as you are saying that it is a problem with the provider.I'm using a fresh installation of Umbraco, without any packages. I get this error just as I reach the site. This is from Firebug Net-console:
So what does the error message mean?
SecurityException:Requestfor the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
The more I know, the easier it will be for me to talk to the provider.
And also. When it comes to reflection. To my knowledge you cannot use reflection in Medium Trust. Am I wrong?
Do anyone know how to see which assembly trying to request System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ?
Umbraco 4.5.2 in medium trust - reflection issue
Hi,
I have a problem installing Umbraco in a medium trust envirionment (Loopia Sweden). I get an error message complaining about ReflectionPermissions.
As I understand Umbraco 4.5.2 should run in medium trust, right?
What I did was:
There seems something is happening because when accessing default.aspx I get redirected to /install/default.aspx?redir=true&url=/default.aspx
But with error message:
Server Error in '/' Application.
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.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3618
Please help,
/Fredrik
Hiya,
Have a look at this post, at the answer from Ben H that's marked as the solution. He mentions some setting that you might need to change, does doing that sort out the problem?
Hi Tim,
I can't see the link to the post?
Sorry, here it is: http://our.umbraco.org/forum/getting-started/installing-umbraco/15821-Installing-Umbraco-and-get-Runtime-error-instead-setup-page?p=0
Thanks for the link Tim,
Unfortunately requirePermission is already set to false in the Umbraco 4.5.2 for .NET 3.5 release so that doesn't help. Forgot to say that i Use .NET 3.5.
I talked to the provider and they say that Umbraco demands support for reflection, which they do not support. But to my knowledge reflection is part of the Medium Trust by default, so Umbraco should support that if it supports Medium trust?
Medium trust isn't a problem with Umbraco 4.5.2, though many hosts run in a custom trust environment based on medium trust (perhaps that's true of your host?).
In any event, not all packages are medium-trust friendly. My ImageGen package, for instance, is not yet medium trust capable.
When do you get the errors, when visiting the website itself, logging into umbraco, viewing a specific page in the Umbraco admin interface, ???
Another option - copy the site locally and set IIS to medium trust. Does it work then? If so then it is a setting with your host and not Umbraco.
cheers,
doug.
What @Doug said. Although the host may support medium trust, they may customise the bits they do and don't support. I know a few hosts that won't let you use reflection, so it might just be that they're running a version of medium trust with reflection disabled. Try setting up a site in medium trusty locally as Doug suggests, and if that works, its definitely the host.
Hi Doug,
According to my provider they are running Medium Trust and they are allowing:
I believe just as you are saying that it is a problem with the provider.I'm using a fresh installation of Umbraco, without any packages. I get this error just as I reach the site. This is from Firebug Net-console:
So what does the error message mean?
SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
The more I know, the easier it will be for me to talk to the provider.
And also. When it comes to reflection. To my knowledge you cannot use reflection in Medium Trust. Am I wrong?
"Medium trust applications have no registry access, no event log access, and no ability to use reflection" from http://msdn.microsoft.com/en-us/library/ff648344.aspx
Do anyone know how to see which assembly trying to request System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ?
Any chance you get an event log entry with a full trace?
cheers,
doug.
Thanks Doug! I'll send an email and ask them
/Fredrik
Thanks for all your help,
I asked provider to for logs. They wouldn't give me. It ended up me getting my money back and moving to another provider.
For now the conclusion is that you cannot install Umbraco 4.5.2 on Loopia (Sweden).
Thanks again for your effort,
Cheers
/Fredrik
is working on a reply...