Skip to main content

Deployed ASP.NET application gives a security exception

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

When trying to run a COBOL/.ASP .Net application that has been deployed to Micro Focus Server you may see a security exception when trying to access the web page that accesses the COBOL code:

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) 48

   Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) 2887817

   Microsoft.Win32.RegistryKey.OpenSubKey(String name) 6

   MicroFocus.COBOL.Runtime.Common.LMF.CheckForDevSystem() 34

   MicroFocus.COBOL.Runtime.Common.LMF.StartRunUnit(Int64 RunUnitId, Boolean IsNoLMF) 30

   MicroFocus.COBOL.Runtime.Common.RunUnit.AddProgram(SaveArea sv) 111

   MicroFocus.COBOL.Program.Control.Init(RuntimeTypeHandle rth) 87

   MoreSys.ccReindex..cctor() 10

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

Resolution:

This is a permissions issue – it is down to the rights associated with the "Network Service" account.

You need to:

Check in Task Manager to see if w3wp.exe is running under that account.

You can then run regedit.exe and give "Network Service" access rights to \\\\HKEY_LOCALMACHINE\\Software\\Micro Focus.

You will then need to restart IIS (use iisreset / restart) and retry. You will then get another error that the license database cannot be accessed.

You need to provide access to c:\\mfaslmf for Network Service.

Old KB# 4436