« Previous Next »

Thread: Security Exception in '/' Application when app pool user is logging in

Last post 07-09-2009 11:23 PM by thewebhostingdir. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 07-06-2009, 3:11 AM

    • scott_3
    • Not Ranked
    • Joined on 07-06-2009, 7:03 AM
    • Posts 4

    Security Exception in '/' Application when app pool user is logging in

    I have an IIS 6.0 server which is getting an execute error when the user defined in the App Pool is logged in on the console.  Unfortunatly I need this user logged in for another application to run which needs to be the same as the one in the App Pool.  The virtual directory is on a UNC path and everything works ok if the user isn't logged in.

     

    Any ideas?

     

     

    The Error is as follows:

    Security Exception body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }

    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.Web.AspNetHostingPermission, System, 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.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
       System.Reflection.Assembly._GetType(String name, Boolean throwOnError, Boolean ignoreCase) +0
       System.Reflection.Assembly.GetType(String name, Boolean throwOnError) +36
       System.Web.Compilation.BuildResultCompiledType.GetPreservedAttributes(PreservationFileReader pfr) +54
       System.Web.Compilation.PreservationFileReader.ReadFileInternal(VirtualPath virtualPath, String preservationFile, Int64 hashCode) +496
       System.Web.Compilation.PreservationFileReader.ReadBuildResultFromFile(VirtualPath virtualPath, String preservationFile, Int64 hashCode) +91
       System.Web.Compilation.DiskBuildResultCache.GetBuildResult(String cacheKey, VirtualPath virtualPath, Int64 hashCode) +66
       System.Web.Compilation.BuildManager.GetBuildResultFromCacheInternal(String cacheKey, Boolean keyFromVPP, VirtualPath virtualPath, Int64 hashCode) +176
       System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +65
       System.Web.Compilation.BuildManager.CompileGlobalAsax() +52
       System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +337
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082
  • 07-06-2009, 10:20 AM In reply to

    Re: Security Exception in '/' Application when app pool user is logging in

    Really you should not be logging in with accounts that are just for the app pool. It sounds like if you do not log in then it is all ok. What is the problem with creating another account with similar permissions?

  • 07-09-2009, 5:22 AM In reply to

    Re: Security Exception in '/' Application when app pool user is logging in

    Hi,

    Could you perform the actions in the follwoing article to grant the FullTrust right to the remote share?

    "System.Security.SecurityException: Security error" error message when the virtual directory points to a remote share in ASP.NET
    http://support.microsoft.com/?id=320268

    Leo Tang
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • 07-09-2009, 7:06 PM In reply to

    • scott_3
    • Not Ranked
    • Joined on 07-06-2009, 7:03 AM
    • Posts 4

    Re: Security Exception in '/' Application when app pool user is logging in

    Hi Leo,

    Thanks for your reply.  The answer is yes and the site works fine as long as the user isn't logged in at the console .

    I've installed an IIS 7 2008 server and the problem doesn't occur there so at this stage we're looking at just doing a full migration.

    Cheers

    Scott

  • 07-09-2009, 11:23 PM In reply to

    Re: Security Exception in '/' Application when app pool user is logging in

    Hi,

    Apply full trust mode to your website and all required permissions of the language support - ASP.Net it should resolve the isue..otherwise set your code as supported by hosting service provider..

     most of the hosting service provider supports medium trust level..

     

    AccuWebHosting.Com - Windows Hosting Expert
    ASP.NET 3.5 | SQL 2005 Database | US Based Hosting Company | 24 X 7 Support | Daily Backups | Uptime Guarantee | Affiliates - $50 Per Sale
    | Online US Jobs | Website Hosting Directory | Windows Hosting
Page 1 of 1 (5 items)