ASP.NET Exception on hosted server

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default ASP.NET Exception on hosted server

    When I run my ASP.NET on my computer it works fine, even in medium trust which is what mt webhost uses. However on the webhost it generates this exceptio
    SecurityException: Request for the permission of type System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
    System.Security.CodeAccessSecurityEngine.CheckHelp er(PermissionSet grantedSet, PermissionSet deniedSet, CodeAccessPermission demand, PermissionToken permToken) +66
    System.Security.CodeAccessSecurityEngine.Check(Per missionToken permToken, CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 checkFrames, Int32 unrestrictedOverride) +
    System.Security.CodeAccessSecurityEngine.Check(Cod eAccessPermission cap, StackCrawlMark& stackMark) +8
    System.Security.CodeAccessPermission.Demand() +6
    System.Web.HttpContext.set_User(IPrincipal value) +7
    newtelligence.DasBlog.Web.Global.Application_Authe nticateRequest(Object sender, EventArgs e) in Global.asax.cs:19
    System.Web.SyncEventExecutionStep.System.Web.HttpA pplication+IExecutionStep.Execute() +6
    System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +8

    Steve Guest

  2. Similar Questions and Discussions

    1. The server threw an exception. (Exception
      I am getting The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)) When i try to open any file using Adobe ...
    2. #32101 [Com]: Exception in unknown on line 0 when throwing exception inside exception handler
      ID: 32101 Comment by: dhopkins at DonHopkins dot com Reported By: ceefour at gauldong dot net Status: No...
    3. Issue using CDO and ASP when hosted from a Windows Server 2003 box
      Hello. I have a function, code below, that I use to send email in ASP via the CDO object. The username and password to the SMTP server are...
    4. Security Exception - Winform usercontrol hosted in ASP.NET
      Please forgive the lengthy post. I am trying to get my winform usercontrol to work properly when hosted in ASP.NET. It is strongly named and has the...
    5. FMPro Server 5.5 Hosted File Disappeared
      In the last 4 days, 2 of my 4 FM database tables have disappeared from the FMPro Server 5.5 list box. The two instances occured 2 days apart from...
  3. #2

    Default RE: ASP.NET Exception on hosted server

    Hi,
    The following could possible scenario. I am not sure what you are doing
    in your app, but you can check this with the hosting provider:

    Your code could be violating SecurityPermissionFlag.ControlPolicy Ability
    to manipulate
    the principal object

    You have to be granted perms to read and write a Principal.Identity.
    In the web.config (or possibly machine.config) they have configured CAS
    policy to
    not grant this permission to the app.
    To (un)restrict, read this page:
    Using Code Access Security with ASP.NET (.NET Framework Security)
    [url]http://msdn.microsoft.com/library/en-us/dnnetsec/html/THCMCh09.asp?frame=tru[/url]
    e

    Basically, you might need to add this in the trust level file for the app.
    <IPermission
    class="SecurityPermission"
    version="1"
    Flags="Assertion, Execution, ControlThread, ControlPrincipal,
    RemotingConfiguration"
    So, the web.config looks like this:

    <trustLevel name="Something" policyFile="someFileLocatedSomeWhere.config"/>

    Find out where someFileLocatedSomeWhere is located, and in that file look
    for the
    <IPermission> from above and add ControlPrincipal.
    Or not. Maybe this hosting provider has a very good reason for not granting
    that
    permission to the app.

    This could happen BECAUSE
    The hosting provider has tightened their Code access security which
    prevents
    this.

    HTH
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Holly

    Holly Mazerolle Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139