Security Exception on ASP.Net app

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Security Exception on ASP.Net app

    I've recently moved an ASP.Net app to our deployment server after it was
    verified on our integration test server.

    On the deployment server I am now getting the following error:
    /*********************************************/
    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: Security error.

    Source Error:


    Line 30: private static bool __intialized = false;
    Line 31:
    Line 32: public Global_asax() {
    Line 33: if ((ASP.Global_asax.__intialized == false)) {
    Line 34: ASP.Global_asax.__intialized = true;


    Source File: C:\WINNT\Microsoft.NET\Framework\v1.0.3705\Tempora ry ASP.NET
    Files\locator\5058f3de\5dc8deb2\bl3wphvz.0.cs Line: 32

    Stack Trace:


    [SecurityException: Security error.]
    Antioch.CreativeMemories.Web.Global..ctor() +0
    ASP.Global_asax..ctor() in
    C:\WINNT\Microsoft.NET\Framework\v1.0.3705\Tempora ry ASP.NET
    Files\locator\5058f3de\5dc8deb2\bl3wphvz.0.cs:32



    /**********************************************/

    The web.config file is the same as the one I'm using on the working servers.
    There are other working .Net apps on the non-working server.
    The app is pretty simple. I'm just receiving an XML stream from another web
    site and running that into a datagrid.

    I've seen lots of others with similar problems but none of the suggestions
    from those threads seemed to work.

    Any ideas or suggestions?

    TIA

    John S



    John Stemper Guest

  2. Similar Questions and Discussions

    1. UserControl Security Exception
      I am trying to write directly to the printer as in article KB322090 but via a usercontrol hosted in an ASPX page. When I get the the OpenPrinter...
    2. EventLogTraceListener Security Exception
      I 'think' my problem is the result of my attempts to use an EventLogTraceListener as I am getting an Security Exception as follows in this...
    3. Security Exception
      On Tue, 06 Jul 2004 20:56:52 GMT, "jamie" <jamie.jones@virgin.net> wrote: It's not an IIS issue. Try annoying just the other five groups for...
    4. strange xsl security exception under asp.net
      hey all, if anyone has any info on the following (or any experiments to suggest), i'd be grateful. i'm at a complete loss. exception: ...
    5. help with Security Exception ??
      Hi, I am getting the following error: Security Exception Description: The application attempted to perform an operation not allowed by the...
  3. #2

    Default RE: Security Exception on ASP.Net app

    Hi John,

    As I understand, the problem only occur on the deployment server, and only
    this web app generate the error. regarding the error message, there is a
    very similar known issue. You may first take a look to see if it is the
    problem:

    [url]http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q320268[/url]
    PRB: "System.Security.SecurityException: Security error" Error Message when
    the Virtual Directory Points to a Remote Share in ASP.NET

    If above article didn't address the problem, you may check if there any
    outer resource used in the ASP.NET app and if it has enough permission. I
    think you may search in event log to see if any permission denied message
    logged.

    Luke
    Microsoft Online Support

    Get Secure! [url]www.microsoft.com/security[/url]
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    MSFT Guest

  4. #3

    Default Re: Security Exception on ASP.Net app

    Thanks for the response.

    I have reviewed the referred to document. The remote XML stream that I am
    accessing is on a third party's web server and is simply returning an XML
    stream. (using the same stream from my test server with success) There
    should not be any shares or remote shares involved.

    The XML stream is a "sort-of-a" web service. We've been asking them to put
    together a real web service but it seems to be beyond their technical grasp.

    Anyway.. I went through the document (Q320268) and unfortunately it didn't
    correct the error.


    Thanks again.

    John



    "MSFT" <lukezhan@online.microsoft.com> wrote in message
    news:pLZQaBZ1DHA.2900@cpmsftngxa07.phx.gbl...
    > Hi John,
    >
    > As I understand, the problem only occur on the deployment server, and only
    > this web app generate the error. regarding the error message, there is a
    > very similar known issue. You may first take a look to see if it is the
    > problem:
    >
    > [url]http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q320268[/url]
    > PRB: "System.Security.SecurityException: Security error" Error Message
    when
    > the Virtual Directory Points to a Remote Share in ASP.NET
    >
    > If above article didn't address the problem, you may check if there any
    > outer resource used in the ASP.NET app and if it has enough permission. I
    > think you may search in event log to see if any permission denied message
    > logged.
    >
    > Luke
    > Microsoft Online Support
    >
    > Get Secure! [url]www.microsoft.com/security[/url]
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >

    John Stemper Guest

  5. #4

    Default Re: Security Exception on ASP.Net app

    Some additional info:

    I've basically removed all code from the main page of the app, recompiled
    and redeployed and I still get the security error.


    John
    "MSFT" <lukezhan@online.microsoft.com> wrote in message
    news:pLZQaBZ1DHA.2900@cpmsftngxa07.phx.gbl...
    > Hi John,
    >
    > As I understand, the problem only occur on the deployment server, and only
    > this web app generate the error. regarding the error message, there is a
    > very similar known issue. You may first take a look to see if it is the
    > problem:
    >
    > [url]http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q320268[/url]
    > PRB: "System.Security.SecurityException: Security error" Error Message
    when
    > the Virtual Directory Points to a Remote Share in ASP.NET
    >
    > If above article didn't address the problem, you may check if there any
    > outer resource used in the ASP.NET app and if it has enough permission. I
    > think you may search in event log to see if any permission denied message
    > logged.
    >
    > Luke
    > Microsoft Online Support
    >
    > Get Secure! [url]www.microsoft.com/security[/url]
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >

    John Stemper Guest

  6. #5

    Default Re: Security Exception on ASP.Net app

    Hi John,

    In the project/reference, did you have any sepecial references like third
    party components or library created by your self? How about the security
    settings for the web folder in IIS, windows integrated or anonymous? and
    did you use Windows authentication in the ASP.NET app?

    Luke
    Microsoft Online Support

    Get Secure! [url]www.microsoft.com/security[/url]
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    MSFT Guest

  7. #6

    Default Re: Security Exception on ASP.Net app

    Luke,

    There are no references to third party components or libraries. I am
    accessing an external URL that returns an XML stream. The code that does
    this is:

    HttpWebRequest oRequest =
    (HttpWebRequest)WebRequest.Create(sbAddress.ToStri ng());
    oRequest.KeepAlive=true;
    HttpWebResponse oResponse = (HttpWebResponse)oRequest.GetResponse();
    Stream stResponse = oResponse.GetResponseStream();
    XmlTextReader xReader = new XmlTextReader(sbAddress.ToString(),stResponse);
    dsAddresses.ReadXml(xReader);

    This code works on my Dev environment and my local machine. It does not work
    on my Test and production machine.
    I get the following error: 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.

    I'm pretty sure it has something to do with accessing the internet from a
    web app but I'm not sure where to go from there.

    Thanks

    John

    "MSFT" <lukezhan@online.microsoft.com> wrote in message
    news:kC7iOWo1DHA.2712@cpmsftngxa07.phx.gbl...
    > Hi John,
    >
    > In the project/reference, did you have any sepecial references like third
    > party components or library created by your self? How about the security
    > settings for the web folder in IIS, windows integrated or anonymous? and
    > did you use Windows authentication in the ASP.NET app?
    >
    > Luke
    > Microsoft Online Support
    >
    > Get Secure! [url]www.microsoft.com/security[/url]
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >

    John Stemper Guest

  8. #7

    Default Re: Security Exception on ASP.Net app

    Hi John,

    Thanks for your followup. Since the KB article doesn't quite suite your
    situation, we need to do some further troubeshoot in it. Would you please
    try the follow tests:
    1. Create a simple web project and just contain on page and put the
    requesting remote xml stream operation in the page and to see whether the
    project will also suffer the problem.

    2. Try create a simple local(intranet) web app on another server which can
    return a xml stream. And query the xml stream from the intranet server to
    see whether this will also cause the problem.

    As for setting the internet accessing security, I still think you may have
    a further check the configuration mentioned in the
    kb(using the .net configuration tool).

    Please check out the above items. If you got any updates or new findings,
    please feel free to post here.


    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! [url]www.microsoft.com/security[/url]
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Get Preview at ASP.NET whidbey
    [url]http://msdn.microsoft.com/asp.net/whidbey/default.aspx[/url]

    Steven Cheng[MSFT] Guest

  9. #8

    Default Re: Security Exception on ASP.Net app

    1. Same problem occurred
    2. Works fine.

    Thanks
    John
    "Steven Cheng[MSFT]" <v-schang@online.microsoft.com> wrote in message
    news:ZpQZRNE$DHA.2452@cpmsftngxa06.phx.gbl...
    > Hi John,
    >
    > Thanks for your followup. Since the KB article doesn't quite suite your
    > situation, we need to do some further troubeshoot in it. Would you please
    > try the follow tests:
    > 1. Create a simple web project and just contain on page and put the
    > requesting remote xml stream operation in the page and to see whether the
    > project will also suffer the problem.
    >
    > 2. Try create a simple local(intranet) web app on another server which can
    > return a xml stream. And query the xml stream from the intranet server to
    > see whether this will also cause the problem.
    >
    > As for setting the internet accessing security, I still think you may have
    > a further check the configuration mentioned in the
    > kb(using the .net configuration tool).
    >
    > Please check out the above items. If you got any updates or new findings,
    > please feel free to post here.
    >
    >
    > Regards,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! [url]www.microsoft.com/security[/url]
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    > Get Preview at ASP.NET whidbey
    > [url]http://msdn.microsoft.com/asp.net/whidbey/default.aspx[/url]
    >

    John Stemper Guest

  10. #9

    Default Re: Security Exception on ASP.Net app

    I was in error on the last posting.

    1. I've stripped down the app to nothing, just the page load event. I still
    get the error.

    John
    "John Stemper" <jstemper@antioch.com> wrote in message
    news:OeP5IYU$DHA.3712@tk2msftngp13.phx.gbl...
    > 1. Same problem occurred
    > 2. Works fine.
    >
    > Thanks
    > John
    > "Steven Cheng[MSFT]" <v-schang@online.microsoft.com> wrote in message
    > news:ZpQZRNE$DHA.2452@cpmsftngxa06.phx.gbl...
    > > Hi John,
    > >
    > > Thanks for your followup. Since the KB article doesn't quite suite your
    > > situation, we need to do some further troubeshoot in it. Would you
    please
    > > try the follow tests:
    > > 1. Create a simple web project and just contain on page and put the
    > > requesting remote xml stream operation in the page and to see whether
    the
    > > project will also suffer the problem.
    > >
    > > 2. Try create a simple local(intranet) web app on another server which
    can
    > > return a xml stream. And query the xml stream from the intranet server
    to
    > > see whether this will also cause the problem.
    > >
    > > As for setting the internet accessing security, I still think you may
    have
    > > a further check the configuration mentioned in the
    > > kb(using the .net configuration tool).
    > >
    > > Please check out the above items. If you got any updates or new
    findings,
    > > please feel free to post here.
    > >
    > >
    > > Regards,
    > >
    > > Steven Cheng
    > > Microsoft Online Support
    > >
    > > Get Secure! [url]www.microsoft.com/security[/url]
    > > (This posting is provided "AS IS", with no warranties, and confers no
    > > rights.)
    > >
    > > Get Preview at ASP.NET whidbey
    > > [url]http://msdn.microsoft.com/asp.net/whidbey/default.aspx[/url]
    > >
    >
    >

    John Stemper Guest

  11. #10

    Default Re: Security Exception on ASP.Net app

    Hi John,

    You mean you made the certain page( in the original web app) 's Page_Load
    empty and still occurs the error? Or have you tried comparing the .net
    security setting on the error server with the develop machine which dosn't
    suffer the problem?
    Or have you tried adding the certain remote site (genrate the xml stream )
    into trusted site? Still think the issue due to security setting.


    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! [url]www.microsoft.com/security[/url]
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Get Preview at ASP.NET whidbey
    [url]http://msdn.microsoft.com/asp.net/whidbey/default.aspx[/url]

    Steven Cheng[MSFT] Guest

  12. #11

    Default Re: Security Exception on ASP.Net app

    Hi John,

    Have you had a chance to try out the suggestoins in my last reply? Just try
    adding the certain remote url(return xml stream) into the trusted site or a
    certain code group which be granted unrestricted permissions via the .net
    configuration tool? If you have any questoins on it, please feel free to
    let me know.




    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! [url]www.microsoft.com/security[/url]
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Get Preview at ASP.NET whidbey
    [url]http://msdn.microsoft.com/asp.net/whidbey/default.aspx[/url]

    Steven Cheng[MSFT] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139