Random error on asp.net app

N

Nalaka

Hi,
I get the following random error... on a asp.net 2.0 aplication.. running at
a hosting company (locally no issues).
It seems like this happens only when pageOutputCache is enabled and when the
app is running on a subDirectory (not root).

Some others that has the same issue.
http://communityserver.org/forums/t/480292.aspx
http://www.dotnetnuke.com/DotNetNuk...d/107/threadid/39821/scope/posts/Default.aspx
http://communityserver.org/forums/t/472075.aspx


Error---------------------------------------------------------------------------
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(Obj ect
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(OutputCachePara meters
cacheSettings)
at ASP.default_aspx.FrameworkInitialize() in
d:\Inetpub\domainid109410\main\Default.aspx.cs:lin e 912309
at System.Web.UI.Page.ProcessRequest(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(Http Context 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\Temp orary ASP.NET
Files\main\f93c3771\1586979\App_Web_-ekklo09.4.cs:line 0
at
System.Web.HttpApplication.CallHandlerExecutionSte
p.System.Web.HttpApplication.IExecutionStep.Execut e()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously)


Thanks
Nalaka
 
S

Steven Cheng[MSFT]

Hi Nalaka,

Regarding on this "Code access security exception in ASP.NET 2.0
application when using output cache", I did ever found some former thread
discussing on this, also I've checked our internal database and found some
similar records.

For this problem, it is quite hard to troubleshoot especially when the host
environment is on a public web hoster. Mostly, the problem is due to that
the ASP.NET runtime occasionally demand a CAS permission which is beyound
the application's CAS policy configuration(configured through <trust
level="..." /> in web.config file). And for public web hoster, it normally
will apply a very low and restricted CAS policy for hosted web
applications. And based on my research in former issues, ASP.NET 2.0 has a
new setting "processRequestInApplicationTrust" by providing an option to
execute the entire page processing code path in the application trust,
including the internal page processing code path and the associated ASP.NET
control
processing. This is configured with the processRequestInApplicationTrust
attribute in the <system.web><trust> configuration section, and is enabled
by default. This setting may cause some of your code to break when it is
registered in the GAC due to the assumption that it will execute with
unrestricted permissions.

So for testing, you can try turning off this attribute to see whether it
helps:

<trust processRequestInApplicationTrust="false" />

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

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.
 
S

Steven Cheng[MSFT]

Hi Nalaka,

Any progress on this issue or does the suggestion in my last reply helps
you some? Due to the complexity of this issue, if the problem you met
doesn't quite fit the scenario I mentioned preiviously, for further
thorough troubleshooting, I suggest you(or suggest your service host
provider) to contact CSS and continue work on this

http://msdn.microsoft.com/subscriptions/support/default.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top