Security Exeception during upgrade

From: SteveWestling (SteveWestling_at_discussions.microsoft.com)
Date: 11/19/05

  • Next message: RC: "Throw Access is Denied Exception when Creating object"
    Date: Sat, 19 Nov 2005 08:30:03 -0800
    
    

    I'm upgrading from a Framework 1.0.3705 app to a Framework 1.1.4322 app. When
    I try to make my first call, where the system registers my components in
    component services. But now I get the following message:

    Server Error in '/theSolver' 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: Requested registry
    access is not allowed.

    Source Error:

    Line 42: UDL = "PS.UDL";
    Line 43: }
    Line 44: doc.LoadXml(user.VerifyLogin(EmailID, Password, RequesterId,
    UDL));
    Line 45: node = doc.SelectSingleNode("//system_user");
    Line 46: RequesterId =
    System.Convert.ToInt32(node.Attributes.GetNamedItem("requester_id").Value);

    Source File: D:\theSolver\PSLogin.aspx Line: 44

    Stack Trace:

    [SecurityException: Requested registry access is not allowed.]
       Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +473
       System.Diagnostics.EventLog.CreateEventSource(String source, String
    logName, String machineName, Boolean useMutex) +443
       System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
    type, Int32 eventID, Int16 category, Byte[] rawData) +347
       System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
    type, Int32 eventID, Int16 category) +21
       System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
    type, Int32 eventID) +15
       System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
    type) +11
       
    PositiveSolutions.SystemUser.PositiveSolutions.ISystemUser.VerifyLogin(String
    EmailId, String Password, Int32 RequesterId, String UDL) +955
       ASP.PSLogin_aspx.__Render__control1(HtmlTextWriter __output, Control
    parameterContainer) in D:\theSolver\PSLogin.aspx:44
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +27
       System.Web.UI.Control.Render(HtmlTextWriter writer) +7
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
       System.Web.UI.Page.ProcessRequestMain() +2112
       System.Web.UI.Page.ProcessRequest() +218
       System.Web.UI.Page.ProcessRequest(HttpContext context) +18
       
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
    completedSynchronously) +87

    Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
    Version:1.1.4322.2032

    So I used the configuration utility and here's what my security.config looks
    like:
    <CodeGroup class="UnionCodeGroup"
                                 version="1"
                                 PermissionSetName="FullTrust"
                                 Name="PBSGroup"
                                 Description="PBS Code group">
                         <IMembershipCondition
    class="StrongNameMembershipCondition"
                                               version="1"
                                               
    PublicKeyBlob="00240000048000009400000006020000002400005253413100040000010001002D1F61710370C9861930434A1516A75F4485DFFF77AC5BD414241318DAD0E1686219397B3D1AD5C272D37DF52BE785FFD56281C800636E21FB47093A6E0FB793901EBBB7884609E5BE659FB27B9BEEA45F195F99C522A892691935C1DB01FE0F4499E75BFD98EC1FE979319BE55DFADBCB8D582E96A67325D9E22EAF1D1C49EA"/>
                      </CodeGroup>

    and I manually editted my machine.config as follows:

    <location allowOverride="true">
            <system.web>
                <securityPolicy>
                    <trustLevel name="Full" policyFile="internal" />
                    <trustLevel name="High" policyFile="web_hightrust.config" />
                    <trustLevel name="Medium"
    policyFile="web_mediumtrust.config" />
                    <trustLevel name="Low" policyFile="web_lowtrust.config" />
                    <trustLevel name="Minimal"
    policyFile="web_minimaltrust.config" />
                </securityPolicy>

                <!-- level="[Full|High|Medium|Low|Minimal]" -->
                <trust level="Full" originUrl="http://127.0.0.1/*" />

            </system.web>
        </location>

    Any thoughts on what I'm overlooking?

    Thanks in advance


  • Next message: RC: "Throw Access is Denied Exception when Creating object"

    Relevant Pages

    • Re: Importing Excel files with columns > 255 chars
      ... or similar string manipulation to get the required maximum length. ... to change the column width of Error output columns, ... Create a connection to that spreadsheet and check the data ... the following registry key when reading the spreadsheet: ...
      (microsoft.public.sqlserver.dts)
    • Re: ascii -> hex-wandler und Reg_Binary eintrag
      ... Integer usw. und Strings klar machen. ... Damit schreibst Du die ASCII-Werte der in dem String OutputText enthaltenen ... Zeichen in die Registry. ... Du solltest Dich erst mal gründlich mit Grundlagen wie Datentypen ...
      (microsoft.public.de.vb)
    • Re: Editing Registry in WinCE 6.0
      ... ActivateDeviceEx and DeactivateDevice calls to load/unload my driver. ... This reads a string value from the reg. ... Copy this registry to file. ... Saves you from having to reboot all the time... ...
      (microsoft.public.windowsce.platbuilder)
    • Re: Securing my app with serial number
      ... The app has two passwords hard-coded into it, we'll call them A and B. ... It then encrypts that string with password A, ... and stores it in the registry as a challenge code. ... I can also insert some extra data into the beginning of unlock code ...
      (microsoft.public.dotnet.languages.vb)
    • OT - Another Windows Vulnerability
      ... The now infamous Regedit vulnerability ... "The weakness is caused due to an error in the Registry Editor ... Utility when handling long string names. ... to hide strings in the "Run" registry key. ...
      (rec.outdoors.rv-travel)