random FileIOPermission error

Discussion in 'ASP .Net' started by Nalaka, Aug 1, 2006.

  1. Nalaka

    Nalaka Guest

    Hi,
    I get the following error at times... I do not read or write to files.
    I do query sql server.
    This error does not happen all the time either.....

    Have you seen this before.... any help is very much appreciated.. as I have
    spent a lot of time looking for a fix.

    mscorlib
    <br>Message: Request for the permission of type
    'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0,
    Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
    <br>Stack trace: at System.Security.CodeAccessSecurityEngine.Check(Object
    demand, StackCrawlMark& stackMark, Boolean isPermSet)
    at System.Security.CodeAccessPermission.Demand()
    at System.IO.Path.GetFullPath(String path)
    at System.Web.Util.FileUtil.IsSuspiciousPhysicalPath(String physicalPath,
    Boolean& pathTooLong)
    at System.Web.Util.FileUtil.IsSuspiciousPhysicalPath(String physicalPath)
    at System.Web.CachedPathData.GetConfigPathData(String configPath)
    at System.Web.CachedPathData.GetConfigPathData(String configPath)
    at System.Web.UI.Page.InitOutputCache(OutputCacheParameters
    cacheSettings)
    at ASP.default_aspx.FrameworkInitialize() in
    d:\Inetpub\domainid109410\main\Default.aspx.cs:line 912309
    at System.Web.UI.Page.ProcessRequest(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.ProcessRequest()
    at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
    at System.Web.UI.Page.ProcessRequest(HttpContext context)
    at ASP.default_aspx.ProcessRequest(HttpContext context) in
    c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
    Files\main\f93c3771\1586979\App_Web_-ekklo09.4.cs:line 0
    at
    System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
    completedSynchronously)


    Thanks
    Nalaka
     
    Nalaka, Aug 1, 2006
    #1
    1. Advertising

  2. Hi Nalaka,

    There's a high chance that you're running background Anti-Virus or Indexing
    Service which may interfere with ASP.NET engine. Try to exclude
    "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files"
    from the Anti-Virus or Indexing Service's scanning folders.

    You can also try to use FileMon from
    http://www.sysinternals.com/Utilities/Filemon.html to see which exact
    errors are reported.

    Hope this helps. Please feel free to post here if anything is unclear.

    Sincerely,
    Walter Wang (, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.

    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Walter Wang [MSFT], Aug 2, 2006
    #2
    1. Advertising

  3. Nalaka

    Nalaka Guest

    Hi Walter,
    The problem is resolved yet.....

    It seems like this only happens when I xcopy a new version of a perticular
    ..aspx to the server.
    (The problem only happens in this page.)

    This .aspx has following that is not in other pages.
    1. Has output caching
    2. Calls a javascript that is on the server.

    Wonder is the new version causes some problem with the caching and
    JavaScript call.
    Thereason I am thinking of Javascript is cause this is a FileIO exception.


    Thanks
    Nalaka





    "Walter Wang [MSFT]" <> wrote in message
    news:...
    > Hi Nalaka,
    >
    > There's a high chance that you're running background Anti-Virus or
    > Indexing
    > Service which may interfere with ASP.NET engine. Try to exclude
    > "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files"
    > from the Anti-Virus or Indexing Service's scanning folders.
    >
    > You can also try to use FileMon from
    > http://www.sysinternals.com/Utilities/Filemon.html to see which exact
    > errors are reported.
    >
    > Hope this helps. Please feel free to post here if anything is unclear.
    >
    > Sincerely,
    > Walter Wang (, remove 'online.')
    > Microsoft Online Community Support
    >
    > ==================================================
    > Get notification to my posts through email? Please refer to
    > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    > ications.
    >
    > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    > where an initial response from the community or a Microsoft Support
    > Engineer within 1 business day is acceptable. Please note that each follow
    > up response may take approximately 2 business days as the support
    > professional working with you may need further investigation to reach the
    > most efficient resolution. The offering is not appropriate for situations
    > that require urgent, real-time or phone-based interactions or complex
    > project analysis and dump analysis issues. Issues of this nature are best
    > handled working with a dedicated Microsoft Support Engineer by contacting
    > Microsoft Customer Support Services (CSS) at
    > http://msdn.microsoft.com/subscriptions/support/default.aspx.
    > ==================================================
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >
     
    Nalaka, Aug 9, 2006
    #3
  4. Hi Nalaka,

    1) Does this issue only exist on one particular server? If not, is it
    possible to create a simpler repro project?
    2) Have you tried to turn off the OutputCache?
    3) Since you mentioned that you think javascript is causing the problem,
    have you tried to remove the javascript tempoarily?

    Excuse me for asking so much questions, but knowing much information will
    help us to better diagnose this issue.

    Regards,
    Walter Wang (, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Walter Wang [MSFT], Aug 10, 2006
    #4
  5. Nalaka

    Nalaka Guest

    Hi Walter,
    Now, I also move web.config.... every time I move a updated file.
    Problem has not happend after that...
    (I think moving web.config causes server to re-compile the whole app...)

    I the problem stops like this... then I will try to recreate the problem
    later.

    Thanks
    Nalaka






    "Walter Wang [MSFT]" <> wrote in message
    news:...
    > Hi Nalaka,
    >
    > 1) Does this issue only exist on one particular server? If not, is it
    > possible to create a simpler repro project?
    > 2) Have you tried to turn off the OutputCache?
    > 3) Since you mentioned that you think javascript is causing the problem,
    > have you tried to remove the javascript tempoarily?
    >
    > Excuse me for asking so much questions, but knowing much information will
    > help us to better diagnose this issue.
    >
    > Regards,
    > Walter Wang (, remove 'online.')
    > Microsoft Online Community Support
    >
    > ==================================================
    > When responding to posts, please "Reply to Group" via your newsreader so
    > that others may learn and benefit from your issue.
    > ==================================================
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >
     
    Nalaka, Aug 10, 2006
    #5
  6. Hi Nalaka,

    Thanks for the info. You are right that change web.config will make the
    whole website restart and recompile. If this stops the problem, then it's
    very much likely that the webform page may have some dependencies or some
    other pages are dependent on it?

    I'm looking forward to your repro project.


    Regards,
    Walter Wang (, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Walter Wang [MSFT], Aug 11, 2006
    #6
  7. Nalaka

    Nalaka Guest

    Hi,
    I stopped caching (output cache) this page, and the error stopped.

    Now have to figure out what exactly causes this random error, when the
    output cache is enabled.
    It seems like the error happens when a new page is generated.
    (sometimes the very first time, sometimes when the output-cache is expired,
    and when to regenerate new page)

    Some info:
    1. This is the only page in the site that had output caching.
    2. Master page (common to all pages) has post cache substitution.
    3. I enabled some code in Application_PreRequestHandlerExecute
    (created a thread to log visitor information)
    Gather information from cookies, and session.
    4. Only page that loads a javascript from server.

    Thanks
    Nalaka


    "Nalaka" <> wrote in message
    news:...
    > Hi,
    > I get the following error at times... I do not read or write to files.
    > I do query sql server.
    > This error does not happen all the time either.....
    >
    > Have you seen this before.... any help is very much appreciated.. as I
    > have spent a lot of time looking for a fix.
    >
    > mscorlib
    > <br>Message: Request for the permission of type
    > 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0,
    > Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
    > <br>Stack trace: at
    > System.Security.CodeAccessSecurityEngine.Check(Object demand,
    > StackCrawlMark& stackMark, Boolean isPermSet)
    > at System.Security.CodeAccessPermission.Demand()
    > at System.IO.Path.GetFullPath(String path)
    > at System.Web.Util.FileUtil.IsSuspiciousPhysicalPath(String
    > physicalPath, Boolean& pathTooLong)
    > at System.Web.Util.FileUtil.IsSuspiciousPhysicalPath(String
    > physicalPath)
    > at System.Web.CachedPathData.GetConfigPathData(String configPath)
    > at System.Web.CachedPathData.GetConfigPathData(String configPath)
    > at System.Web.UI.Page.InitOutputCache(OutputCacheParameters
    > cacheSettings)
    > at ASP.default_aspx.FrameworkInitialize() in
    > d:\Inetpub\domainid109410\main\Default.aspx.cs:line 912309
    > at System.Web.UI.Page.ProcessRequest(Boolean
    > includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    > at System.Web.UI.Page.ProcessRequest()
    > at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
    > at System.Web.UI.Page.ProcessRequest(HttpContext context)
    > at ASP.default_aspx.ProcessRequest(HttpContext context) in
    > c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
    > Files\main\f93c3771\1586979\App_Web_-ekklo09.4.cs:line 0
    > at
    > System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    > at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
    > completedSynchronously)
    >
    >
    > Thanks
    > Nalaka
    >
    >
     
    Nalaka, Aug 14, 2006
    #7
  8. Nalaka

    Nalaka Guest

    Thanks Walter....
    I will create the smallest project that gives this problem, and send it....

    Thanks
    Nalaka



    "Walter Wang [MSFT]" <> wrote in message
    news:...
    > Hi Nalaka,
    >
    > I was unable to reproduce the issue based on your provided information.
    > Here's my steps:
    >
    > 1) Create a web site on remote IIS 6.0 server
    > 2) Add a master page, add an post-cache substituation with
    > <asp:substituation> control
    > 3) Add a content page, enable its output cache; include a javascript
    > reference;
    > 4) Add global.asax, add Application_PreRequestHandlerExecute;
    > 5) View the content page in browser, then manually copy over the content
    > page to update it; then refresh the page in browser
    >
    > I'm sure there must have some specific things that I didn't catch using
    > this simple project. Would you please take some time to see if it's
    > possible to create a repro project based on it?
    >
    > I'll attach the web site I'm using here. (You may need to use Outlook
    > Express to download attachments)
    >
    >
    >
    > Regards,
    > Walter Wang (, remove 'online.')
    > Microsoft Online Community Support
    >
    > ==================================================
    > When responding to posts, please "Reply to Group" via your newsreader so
    > that others may learn and benefit from your issue.
    > ==================================================
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
     
    Nalaka, Aug 15, 2006
    #8
  9. Hi Nalaka,

    I don't know if you ever had a chance to test the web site on a different
    server, this may prove it's related to the server or to the code.

    Normally if I would be debugging such problem, I would take following steps:

    1) Create a copy of the web site
    2) Remove irrelevant files from the web site, everytime when you remove the
    files, make sure the problematic page still works (and still fails randomly)
    3) Or try to comment out code in the problematic page
    4) Repeat step 2 or 3 until the problem goes away; remember what did you
    just removed, and that maybe the root cause of this problem.

    I'm looking forward to your findings...


    Regards,
    Walter Wang (, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Walter Wang [MSFT], Aug 17, 2006
    #9
    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.
Similar Threads
  1. =?Utf-8?B?cGF1bA==?=

    System.Security.Permissions.FileIOPermission

    =?Utf-8?B?cGF1bA==?=, Oct 1, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    958
    =?Utf-8?B?cGF1bA==?=
    Oct 1, 2004
  2. Carl Gilbert
    Replies:
    0
    Views:
    459
    Carl Gilbert
    Oct 4, 2006
  3. globalrev
    Replies:
    4
    Views:
    774
    Gabriel Genellina
    Apr 20, 2008
  4. Replies:
    0
    Views:
    316
  5. VK
    Replies:
    15
    Views:
    1,179
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page