date Picker - medium trust

10 posts, 0 answers
  1. Miran Zgec
    Miran Zgec avatar
    14 posts
    Member since:
    Oct 2006

    Posted 11 Apr 2008 Link to this post

    Hello

    I'm having problems with DatePicker and shared hosting enviroment.

    When using with default medium-trust configuration (on my local machine), datePicker works fine.
    On remote server I get some trust related error (tried that on two different hosting servers)

    I found out that they use modified medium trust configurations, with some reflecion limitations, that your datePicker comes to conflict with.

    This is the respose I got from server suport:
    I can see you're having Reflection permission issues. We do use medium trust but we use identity impersonate for tighter security opposed to allowing reflection permissions.

    Are you planning to fix this, or is there some workaround?

    Oh and your normal Calendar works ok in the same enviroment :)




  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 11 Apr 2008 Link to this post

    Hello Miran,

    I just checked this and everything seems work fine on my end with normal "Medium" trust. You can find an example attached. Can you post a bit more info related to the exception?

    Greetings,
    Vlad
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. gerry
    gerry avatar
    48 posts
    Member since:
    May 2007

    Posted 08 May 2008 Link to this post

    I'm having the same problem. Local with medium trust fine.  But on my shared hosting server I get an 'System.Security.SecurityException: Request for the permisison of type 'System.Security.Permissions.RefelctionPermission,......' failed.

    This is a serious problem and it looks like I'll have to go modify a bunch of code to use the non 2008 Ajax version.

    Gerry
  4. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 08 May 2008 Link to this post

    Hi gerry,

    Can you post a bit more info (full stack trace)? You can check also the example from my previous reply.

    All the best,
    Vlad
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. gerry
    gerry avatar
    48 posts
    Member since:
    May 2007

    Posted 08 May 2008 Link to this post

    Here is my stack trace.  I'll see if i can upload the example to my shared host and test it out.

    Gerry
    ==

    System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    Generated: Thu, 08 May 2008 06:35:46 GMT

     
    System.Reflection.TargetInvocationException: Property accessor 'UseRowHeadersAsSelectors' on object 'Telerik.Web.UI.DatePickingCalendar' threw the following exception:'Telerik.Web.UI.DatePickingCalendar.get_UseRowHeadersAsSelectors()' ---> System.MethodAccessException: Telerik.Web.UI.DatePickingCalendar.get_UseRowHeadersAsSelectors() ---> System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
       at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
       at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object assemblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
       at System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Object assemblyOrString, SecurityAction action, Boolean throwException)
       at System.Security.PermissionSetTriple.CheckSetDemand(PermissionSet demandSet, PermissionSet& alteredDemandset, RuntimeMethodHandle rmh)
       at System.Security.PermissionListSet.CheckSetDemand(PermissionSet pset, RuntimeMethodHandle rmh)
       at System.Security.PermissionListSet.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet)
       at System.Threading.CompressedStack.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet)
       at System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant, CompressedStack securityContext)
       at System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant)
    The action that failed was:
    Demand
    The type of the first permission that failed was:
    System.Security.Permissions.ReflectionPermission
       --- End of inner exception stack trace ---
       at System.Reflection.MethodBase.PerformSecurityCheck(Object obj, RuntimeMethodHandle method, IntPtr parent, UInt32 invocationFlags)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.ComponentModel.ReflectPropertyDescriptor.GetValue(Object component)
       --- End of inner exception stack trace ---
       at System.ComponentModel.ReflectPropertyDescriptor.GetValue(Object component)
       at System.ComponentModel.ReflectPropertyDescriptor.ShouldSerializeValue(Object component)
       at Telerik.Web.ScriptObjectBuilder.DescribeComponent(Object instance, ScriptComponentDescriptor descriptor, IUrlResolutionService urlResolver, IControlResolver controlResolver)
       at Telerik.Web.UI.ScriptRegistrar.GetScriptDescriptors(WebControl control)
       at Telerik.Web.UI.RadWebControl.GetScriptDescriptors()
       at Telerik.Web.UI.RadWebControl.System.Web.UI.IScriptControl.GetScriptDescriptors()
       at System.Web.UI.ScriptControlManager.RegisterScriptDescriptors(IScriptControl scriptControl)
       at System.Web.UI.ScriptManager.RegisterScriptDescriptors(IScriptControl scriptControl)
       at Telerik.Web.UI.RadWebControl.RegisterScriptDescriptors()
       at Telerik.Web.UI.RadCalendar.Render(HtmlTextWriter writer)
       at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
       at Telerik.Web.UI.RadDatePicker.AddControlComponents(HtmlTextWriter writer)
       at Telerik.Web.UI.RadDatePicker.RenderChildren(HtmlTextWriter writer)
       at System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer)
       at Telerik.Web.UI.RadDatePicker.RenderContents(HtmlTextWriter writer)
       at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer)
       at Telerik.Web.UI.RadDatePicker.Render(HtmlTextWriter writer)
       at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
       at ASP.fields_addfieldslot_aspx.__Rendercp(HtmlTextWriter __w, Control parameterContainer)
       at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
       at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
       at System.Web.UI.Control.Render(HtmlTextWriter writer)
       at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
       at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
       at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
       at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)
       at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output)
       at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
       at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer)
       at ASP.masterpages_programview_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer)
       at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
       at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
       at System.Web.UI.Control.Render(HtmlTextWriter writer)
       at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
       at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
       at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
       at System.Web.UI.Page.Render(HtmlTextWriter writer)
       at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
       at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
       at System.Web.UI.Page.ProcessRequest()
       at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
       at System.Web.UI.Page.ProcessRequest(HttpContext context)
       at ASP.fields_addfieldslot_aspx.ProcessRequest(HttpContext context)
       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
  6. gerry
    gerry avatar
    48 posts
    Member since:
    May 2007

    Posted 08 May 2008 Link to this post

    Vlad,

    I uploaded your sample to my shared hosting environment and put it in it's own subdomain.  I still get the security error.  Here is the traceback.  I should also note that I tried it both with the telerik.web.ui.dll that is in the zip as well as the released Q1 dll.

    Gerry
    =
     

    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:

    [SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
       System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed) +150
       System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object assemblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed) +100
       System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Object assemblyOrString, SecurityAction action, Boolean throwException) +281
       System.Security.PermissionSetTriple.CheckSetDemand(PermissionSet demandSet, PermissionSet& alteredDemandset, RuntimeMethodHandle rmh) +67
       System.Security.PermissionListSet.CheckSetDemand(PermissionSet pset, RuntimeMethodHandle rmh) +145
       System.Security.PermissionListSet.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet) +43
       System.Threading.CompressedStack.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet) +41
       System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant, CompressedStack securityContext) +139
       System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant) +51
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
  7. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 08 May 2008 Link to this post

    Hi gerry,

    This looks like modified "Medium" trust level or even "Low" trust level -  I have attached the default web_mediumtrust.config file which can be found in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\ folder.

    Can you please check if there are any differences with your current configuration?

    All the best,
    Vlad
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. gerry
    gerry avatar
    48 posts
    Member since:
    May 2007

    Posted 08 May 2008 Link to this post

    Vlad,

    This is a shared server and thus I do not have access to their config files.  However, I have submitted a request item and will see what they say.

    Gerry
  9. gerry
    gerry avatar
    48 posts
    Member since:
    May 2007

    Posted 12 May 2008 Link to this post

    I thought I had replied to this but I guess it was in another thread for a similar permissions issue with the panelbar.  I mentioned in the other thread that the hosting company will not send me their configuration data due to security concerns.

    I was sent a patch for the panelbar and it fixes the security problem for the panelbar.  However, it doesn't fix the date time picker problem.

    Gerry
  10. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 13 May 2008 Link to this post

    Hi gerry,

    Indeed finally we manage to reproduce this and the problem was fixes successfully. The fix will be available with our  first service pack later this week.

    Kind regards,
    Vlad
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top