Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Registry access

Registry access

Scheduled Pinned Locked Moved ASP.NET
sysadmincsharpasp-netdotnetvisual-studio
9 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    siva455
    wrote on last edited by
    #1

    Hi, I have a web application in where in my default page cs file i didn"t write anything and i have created an msi using set up and deployment provided by VS 2005 and installed that msi in other machine and when im trying access it thru url im getting the below error.... Server Error in '/Skywebadmin' 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: 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: Requested registry access is not allowed.] System.ThrowHelper.ThrowSecurityException(ExceptionResource resource) +51 Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +7460233 System.Security.Cryptography.Utils.get_FipsAlgorithmPolicy() +239 System.Security.Cryptography.RijndaelManaged..ctor() +13 System.Web.Configuration.MachineKeySection.ConfigureEncryptionObject() +232 System.Web.Configuration.MachineKeySection.EnsureConfig() +156 System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo) +34 System.Web.UI.Page.EncryptStringWithIV(String s, IVType ivType) +83 System.Web.UI.Page.EncryptString(String s) +30 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

    N A 2 Replies Last reply
    0
    • S siva455

      Hi, I have a web application in where in my default page cs file i didn"t write anything and i have created an msi using set up and deployment provided by VS 2005 and installed that msi in other machine and when im trying access it thru url im getting the below error.... Server Error in '/Skywebadmin' 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: 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: Requested registry access is not allowed.] System.ThrowHelper.ThrowSecurityException(ExceptionResource resource) +51 Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +7460233 System.Security.Cryptography.Utils.get_FipsAlgorithmPolicy() +239 System.Security.Cryptography.RijndaelManaged..ctor() +13 System.Web.Configuration.MachineKeySection.ConfigureEncryptionObject() +232 System.Web.Configuration.MachineKeySection.EnsureConfig() +156 System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo) +34 System.Web.UI.Page.EncryptStringWithIV(String s, IVType ivType) +83 System.Web.UI.Page.EncryptString(String s) +30 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      pradeep455 wrote:

      System.Security.SecurityException: Requested registry access is not allowed.

      What part of that error message is unclear? :)

      Navaneeth How to use google | Ask smart questions

      S 1 Reply Last reply
      0
      • N N a v a n e e t h

        pradeep455 wrote:

        System.Security.SecurityException: Requested registry access is not allowed.

        What part of that error message is unclear? :)

        Navaneeth How to use google | Ask smart questions

        S Offline
        S Offline
        siva455
        wrote on last edited by
        #3

        Thanks for ur reply... If you are aware of the solution please let me know.....

        N 1 Reply Last reply
        0
        • S siva455

          Thanks for ur reply... If you are aware of the solution please let me know.....

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          There is no solution. Change your design. Why ASP.NET application requires registry access? Usually hosting providers will not give access to registry. If you have a dedicated server, you can impersonate the user before accessing registry. But it is nasty.

          Navaneeth How to use google | Ask smart questions

          S 1 Reply Last reply
          0
          • N N a v a n e e t h

            There is no solution. Change your design. Why ASP.NET application requires registry access? Usually hosting providers will not give access to registry. If you have a dedicated server, you can impersonate the user before accessing registry. But it is nasty.

            Navaneeth How to use google | Ask smart questions

            S Offline
            S Offline
            siva455
            wrote on last edited by
            #5

            Sorry the issue is im not accessing any registry..and moreover i did"nt write any code inside cs file ...and i guess by default ASPNET application may require access to registry....

            1 Reply Last reply
            0
            • S siva455

              Hi, I have a web application in where in my default page cs file i didn"t write anything and i have created an msi using set up and deployment provided by VS 2005 and installed that msi in other machine and when im trying access it thru url im getting the below error.... Server Error in '/Skywebadmin' 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: 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: Requested registry access is not allowed.] System.ThrowHelper.ThrowSecurityException(ExceptionResource resource) +51 Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +7460233 System.Security.Cryptography.Utils.get_FipsAlgorithmPolicy() +239 System.Security.Cryptography.RijndaelManaged..ctor() +13 System.Web.Configuration.MachineKeySection.ConfigureEncryptionObject() +232 System.Web.Configuration.MachineKeySection.EnsureConfig() +156 System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo) +34 System.Web.UI.Page.EncryptStringWithIV(String s, IVType ivType) +83 System.Web.UI.Page.EncryptString(String s) +30 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

              A Offline
              A Offline
              Ashutosh Phoujdar
              wrote on last edited by
              #6

              pradeep455 wrote:

              SecurityException: Requested registry access is not allowed.] System.ThrowHelper.ThrowSecurityException(ExceptionResource resource) +51 Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +7460233 System.Security.Cryptography.Utils.get_FipsAlgorithmPolicy() +239 System.Security.Cryptography.RijndaelManaged..ctor() +13 System.Web.Configuration.MachineKeySection.ConfigureEncryptionObject() +232 System.Web.Configuration.MachineKeySection.EnsureConfig() +156 System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo) +34 System.Web.UI.Page.EncryptStringWithIV(String s, IVType ivType) +83 System.Web.UI.Page.EncryptString(String s) +30

              Looks like your are using some session settings in web.config, and that is trying to access machine key for encrypting session data (Although not sure).

              dnpro "Very bad programmer" My Latest Articles RichTextBox Control with Find functionality LogViewer - A Simple Log Listening Utility

              S 1 Reply Last reply
              0
              • A Ashutosh Phoujdar

                pradeep455 wrote:

                SecurityException: Requested registry access is not allowed.] System.ThrowHelper.ThrowSecurityException(ExceptionResource resource) +51 Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +7460233 System.Security.Cryptography.Utils.get_FipsAlgorithmPolicy() +239 System.Security.Cryptography.RijndaelManaged..ctor() +13 System.Web.Configuration.MachineKeySection.ConfigureEncryptionObject() +232 System.Web.Configuration.MachineKeySection.EnsureConfig() +156 System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo) +34 System.Web.UI.Page.EncryptStringWithIV(String s, IVType ivType) +83 System.Web.UI.Page.EncryptString(String s) +30

                Looks like your are using some session settings in web.config, and that is trying to access machine key for encrypting session data (Although not sure).

                dnpro "Very bad programmer" My Latest Articles RichTextBox Control with Find functionality LogViewer - A Simple Log Listening Utility

                S Offline
                S Offline
                siva455
                wrote on last edited by
                #7

                Hi , The below is my web.config... please have a look Actually the below is web.config for AJAX ENabled ASP.net web application It"s a plain application ie no code wa written in cs file... Really im struggling frm 2 days please try to help me out... below is web.config... <?xml version="1.0"?> <configuration> <configSections> <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/> <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" /> <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" /> <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" /> </sectionGroup> </sectionGroup> </sectionGroup> </configSections> <system.web> <pages> <controls> <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </controls> </pages> <!-- Set compilation debug="true" to insert debugg

                A 1 Reply Last reply
                0
                • S siva455

                  Hi , The below is my web.config... please have a look Actually the below is web.config for AJAX ENabled ASP.net web application It"s a plain application ie no code wa written in cs file... Really im struggling frm 2 days please try to help me out... below is web.config... <?xml version="1.0"?> <configuration> <configSections> <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/> <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" /> <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" /> <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" /> </sectionGroup> </sectionGroup> </sectionGroup> </configSections> <system.web> <pages> <controls> <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </controls> </pages> <!-- Set compilation debug="true" to insert debugg

                  A Offline
                  A Offline
                  Ashutosh Phoujdar
                  wrote on last edited by
                  #8

                  Although Not complete solution, But I got some clues : http://support.microsoft.com/kb/329291[^] http://geekswithblogs.net/TimH/archive/2005/10/05/56029.aspx[^] http://forums.codecharge.com/posts.php?post_id=67135[^] All of the above post states that if application is trying to write to Event Log then is gives such exception. However :confused: You are saying there is no code in application. Still digging. :sigh:

                  dnpro "Very bad programmer" My Latest Articles RichTextBox Control with Find functionality LogViewer - A Simple Log Listening Utility

                  S 1 Reply Last reply
                  0
                  • A Ashutosh Phoujdar

                    Although Not complete solution, But I got some clues : http://support.microsoft.com/kb/329291[^] http://geekswithblogs.net/TimH/archive/2005/10/05/56029.aspx[^] http://forums.codecharge.com/posts.php?post_id=67135[^] All of the above post states that if application is trying to write to Event Log then is gives such exception. However :confused: You are saying there is no code in application. Still digging. :sigh:

                    dnpro "Very bad programmer" My Latest Articles RichTextBox Control with Find functionality LogViewer - A Simple Log Listening Utility

                    S Offline
                    S Offline
                    siva455
                    wrote on last edited by
                    #9

                    In windows 2003 server in IIs 6.0 when i tried to change the process account of the application pool to Local System through script(because i should not change manually and that(changing process account) should happen when installing MSI itself) it worked fine ie in IIS 6.0 but im strugling how should i change process acount to Local system in IIS 5.0 thru script.... Any way changing process account to Local System is not safe but i cannot manually go to registry and add the ASPNET account and give read and write access.... And in IIS 5.0 ie in Windows Xp pro if i set Permissions for HKLM\SYSTEM\CurrentControlSet\Control\Lsa Select this key and add ASPNET machine account with read and write permissions then im able to clear error Where LSA(local Security Authority)... But as i said i should not do manually....

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups