Security Exception Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

Discussion in 'ASP .Net' started by wenning@kvsa.nl, Aug 18, 2006.

  1. Guest

    Hello,

    I am struggling with a website on a W2K3 server which has the actual
    content on a NAS server (also W2K3 based). The servers doesn't run in a
    domain and arent intended to.

    I did make the web space on the W2K3 IIS Server and pointed it to the
    NAS server via an UNC path (no virtual directory).

    When I place the content on the IIS, everything works fine, but when I
    want to use the content on the NAS, I get the following error message
    in my IE :

    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.Web.UI.Util.GetTypeFromAssemblies(ICollection assemblies,
    String typeName, Boolean ignoreCase) +140
    System.Web.UI.TemplateParser.GetType(String typeName, Boolean
    ignoreCase, Boolean throwOnError) +295
    System.Web.UI.TemplateParser.ProcessInheritsAttribute(String
    baseTypeName, String codeFileBaseTypeName, String src, Assembly
    assembly) +163

    System.Web.UI.TemplateParser.PostProcessMainDirectiveAttributes(IDictionary
    parseData) +192




    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.50727.42;
    ASP.NET Version:2.0.50727.42

    My Event Log tells me :

    Event code: 4010
    Event message: An unhandled security exception has occurred.
    Event time: 8/18/2006 4:47:59 PM
    Event time (UTC): 8/18/2006 2:47:59 PM
    Event ID: 39b77da5032a40a4ae4f3490228b47c6
    Event sequence: 1
    Event occurrence: 1
    Event detail code: 0

    Application information:
    Application domain: /LM/W3SVC/1542597267/Root-4-128003860780000000
    Trust level: Full
    Application Virtual Path: /
    Application Path: \\bullseye\Websites\www.digitalnews.nl\
    Machine name: SEASPIKE

    Process information:
    Process ID: 608
    Process name: w3wp.exe
    Account name: NT AUTHORITY\NETWORK SERVICE

    Request information:
    Request URL: http://www.digitalnews.nl/Default.aspx
    Request path: /Default.aspx
    User host address: 192.168.150.20
    User:
    Is authenticated: False
    Authentication Type:
    Thread account name: SEASPIKE\IIS_Server

    Custom event details:

    For more information, see Help and Support Center at

    Anyone an idea what could be wrong and how I can solve it ?
    Help would be very much appreciated ! Thank you !

    Regards,

    Ferry Wenning
     
    , Aug 18, 2006
    #1
    1. Advertising

  2. by default the asp.net system account does not have network access, so unc
    shares are not allowed. yu need to change the machine account to one that
    has network access. also because you code will be runing from a share, it
    run in a sandbox with restricted access. you will probably need to make the
    share trusted.

    -- bruce (sqlwork.com)


    <> wrote in message
    news:...
    > Hello,
    >
    > I am struggling with a website on a W2K3 server which has the actual
    > content on a NAS server (also W2K3 based). The servers doesn't run in a
    > domain and arent intended to.
    >
    > I did make the web space on the W2K3 IIS Server and pointed it to the
    > NAS server via an UNC path (no virtual directory).
    >
    > When I place the content on the IIS, everything works fine, but when I
    > want to use the content on the NAS, I get the following error message
    > in my IE :
    >
    > 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.Web.UI.Util.GetTypeFromAssemblies(ICollection assemblies,
    > String typeName, Boolean ignoreCase) +140
    > System.Web.UI.TemplateParser.GetType(String typeName, Boolean
    > ignoreCase, Boolean throwOnError) +295
    > System.Web.UI.TemplateParser.ProcessInheritsAttribute(String
    > baseTypeName, String codeFileBaseTypeName, String src, Assembly
    > assembly) +163
    >
    > System.Web.UI.TemplateParser.PostProcessMainDirectiveAttributes(IDictionary
    > parseData) +192
    >
    >
    >
    >
    > --------------------------------------------------------------------------------
    > Version Information: Microsoft .NET Framework Version:2.0.50727.42;
    > ASP.NET Version:2.0.50727.42
    >
    > My Event Log tells me :
    >
    > Event code: 4010
    > Event message: An unhandled security exception has occurred.
    > Event time: 8/18/2006 4:47:59 PM
    > Event time (UTC): 8/18/2006 2:47:59 PM
    > Event ID: 39b77da5032a40a4ae4f3490228b47c6
    > Event sequence: 1
    > Event occurrence: 1
    > Event detail code: 0
    >
    > Application information:
    > Application domain: /LM/W3SVC/1542597267/Root-4-128003860780000000
    > Trust level: Full
    > Application Virtual Path: /
    > Application Path: \\bullseye\Websites\www.digitalnews.nl\
    > Machine name: SEASPIKE
    >
    > Process information:
    > Process ID: 608
    > Process name: w3wp.exe
    > Account name: NT AUTHORITY\NETWORK SERVICE
    >
    > Request information:
    > Request URL: http://www.digitalnews.nl/Default.aspx
    > Request path: /Default.aspx
    > User host address: 192.168.150.20
    > User:
    > Is authenticated: False
    > Authentication Type:
    > Thread account name: SEASPIKE\IIS_Server
    >
    > Custom event details:
    >
    > For more information, see Help and Support Center at
    >
    > Anyone an idea what could be wrong and how I can solve it ?
    > Help would be very much appreciated ! Thank you !
    >
    > Regards,
    >
    > Ferry Wenning
    >
    >
     
    bruce barker \(sqlwork.com\), Aug 18, 2006
    #2
    1. Advertising

  3. Guest

    After fighting and reading for two hours, Here's my fix.

    On IIS 6.0 , the website in question, the Home Directory needs to be a
    directory located on this computer, not a UNC name ( or a share located
    on another comptuer). Yes, it can still be a shared folder, but the
    location needs to be drive:\folder

    With half my hair missing,

    Rob

    bruce barker (sqlwork.com) wrote:
    > by default the asp.net system account does not have network access, so unc
    > shares are not allowed. yu need to change the machine account to one that
    > has network access. also because you code will be runing from a share, it
    > run in a sandbox with restricted access. you will probably need to make the
    > share trusted.
    >
    > -- bruce (sqlwork.com)
     
    , Aug 21, 2006
    #3
  4. Guest

    After fighting and reading for two hours, Here's my fix.

    On IIS 6.0 , the website in question, the Home Directory needs to be a
    directory located on this computer, not a UNC name ( or a share located
    on another comptuer). Yes, it can still be a shared folder, but the
    location needs to be drive:\folder

    With half my hair missing,

    Rob

    bruce barker (sqlwork.com) wrote:
    > by default the asp.net system account does not have network access, so unc
    > shares are not allowed. yu need to change the machine account to one that
    > has network access. also because you code will be runing from a share, it
    > run in a sandbox with restricted access. you will probably need to make the
    > share trusted.
    >
    > -- bruce (sqlwork.com)
     
    , Aug 21, 2006
    #4
  5. Guest

    After fighting and reading for two hours, Here's my fix.

    On IIS 6.0 , the website in question, the Home Directory needs to be a
    directory located on this computer, not a UNC name ( or a share located
    on another comptuer). Yes, it can still be a shared folder, but the
    location needs to be drive:\folder

    With half my hair missing,

    Rob

    bruce barker (sqlwork.com) wrote:
    > by default the asp.net system account does not have network access, so unc
    > shares are not allowed. yu need to change the machine account to one that
    > has network access. also because you code will be runing from a share, it
    > run in a sandbox with restricted access. you will probably need to make the
    > share trusted.
    >
    > -- bruce (sqlwork.com)
     
    , Aug 21, 2006
    #5
  6. Guest

    Hi,

    Thank you for submitting your tips and tricks.
    It did the job, everything is working properly now !

    Regards,

    Ferry Wenning
     
    , Aug 23, 2006
    #6
  7. tinvan

    Joined:
    Sep 21, 2006
    Messages:
    1
    I am still getting the same error

    I tried what you tried.
    But I am getting the following message :

    ---------------------------------
    Server cannot access application directory 'Z:\Site\'. The directory does not exist or is not accessible because of security settings.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Web.HttpException: Server cannot access application directory 'Z:\Site\'. The directory does not exist or is not accessible because of security settings.

    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:


    [HttpException (0x80004005): Server cannot access application directory 'Z:\Site\'. The directory does not exist or is not accessible because of security settings.]
    System.Web.HttpRuntime.EnsureAccessToApplicationDirectory() +3518182
    System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags) +87

    [HttpException (0x80004005): Server cannot access application directory 'Z:\Site\'. The directory does not exist or is not accessible because of security settings.]
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3430031
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
    System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +252




    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.62
    ________________________________________________________________

    It seems ASP.Net is not able to access the folder, but I have given all the permissions to the mapped path.

    Did you do any thing else, which you have not mentioned here ?

    Thanks in advance...
     
    tinvan, Sep 21, 2006
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page