I'm using a managed server and have to use medium trust to run my site, it was based on PSS.
It works most of the time, but sometimes it will give me a permissions error. It will be up for hours, then I get this error for a while, but if I refresh enough times it will eventually work? The people who run the managed server are stumped. Can PSS run on medium trust? Is there something I need to change?
Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
[No relevant source lines]
Source File: App_Web_default.aspx.cdcab7d2.cmshozre.0.cs Line: 0
Stack Trace:
[SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessPermission.Demand() +59
System.IO.Path.GetFullPath(String path) +98
System.Web.Util.FileUtil.IsSuspiciousPhysicalPath(String physicalPath, Boolean& pathTooLong) +50
System.Web.Util.FileUtil.IsSuspiciousPhysicalPath(String physicalPath) +23
System.Web.CachedPathData.GetConfigPathData(String configPath) +465
System.Web.CachedPathData.GetConfigPathData(String configPath) +243
System.Web.CachedPathData.GetConfigPathData(String configPath) +243
System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) +132
System.Web.HttpContext.GetPathData(VirtualPath path) +3372026
System.Web.Security.UrlAuthorizationModule.IsUserAllowedToPath(HttpContext context, VirtualPath virtualPath) +132
System.Web.UI.Util.IsUserAllowedToPath(HttpContext context, VirtualPath virtualPath) +101
System.Web.SiteMapProvider.IsAccessibleToUser(HttpContext context, SiteMapNode node) +367
System.Web.SiteMapNode.IsAccessibleToUser(HttpContext context) +14
System.Web.StaticSiteMapProvider.GetChildNodes(SiteMapNode node) +348
System.Web.SiteMapNode.get_ChildNodes() +23
System.Web.SiteMapNode.get_HasChildNodes() +4
System.Web.SiteMapNode.System.Web.UI.IHierarchyData.get_HasChildren() +4
System.Web.UI.WebControls.Menu.DataBindRecursive(MenuItem node, IHierarchicalEnumerable enumerable) +4225
System.Web.UI.WebControls.Menu.DataBindItem(MenuItem item) +277
System.Web.UI.WebControls.Menu.PerformDataBinding() +117
System.Web.UI.WebControls.HierarchicalDataBoundControl.PerformSelect() +82
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.Menu.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.Menu.EnsureDataBound() +29
System.Web.UI.WebControls.Menu.OnPreRender(EventArgs e, Boolean registerScript) +21
System.Web.UI.WebControls.Menu.OnPreRender(EventArgs e) +22
System.Web.UI.Control.PreRenderRecursiveInternal() +77
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6953
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +154
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP._default_aspx.ProcessRequest(HttpContext context) in App_Web_default.aspx.cdcab7d2.cmshozre.0.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
My web.config
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=SQLB1.xxxxxxxx.com;Initial Catalog=xxxxxx;Persist Security Info=True;User ID=xxxxxxx;Password=xxxxxx"
providerName="System.Data.SqlClient" />
<
add name="loftladbConnectionString" connectionString="Data Source=SQLB1.webcontrolcenter.com;Initial Catalog=xxxxxxx;Persist Security Info=True;User ID=xxxxxxx;Password=xxxxxxxx"
providerName="System.Data.SqlClient" />
</
connectionStrings>
<
system.web>
<
pages styleSheetTheme="White"/>
<
customErrors mode="RemoteOnly" defaultRedirect="http://www.loftla.com/lofts/index.html"/>
<
compilation debug="false"/>
<
membership defaultProvider="YourSqlProvider">
<
providers>
<
add connectionStringName="LocalSqlServer" applicationName="/LoftLAApp" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" name="YourSqlProvider" type="System.Web.Security.SqlMembershipProvider"/>
</
providers>
</
membership>
<
authentication mode="Forms">
<
forms loginUrl="default1.aspx" protection="Validation" timeout="300"/>
</
authentication>
<
authorization>
<
allow users="*"/>
</
authorization>
<
globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
<
roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider"/>
<
siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
<
providers>
<
add name="XmlSiteMapProvider" description="SiteMap provider which reads in .sitemap XML files." type="System.Web.XmlSiteMapProvider, System.Web, Versionfiltered=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" siteMapFile="web.sitemap" securityTrimmingEnabled="true"/>
</
providers>
</
siteMap>
</
system.web>
<
location path="Admin">
<
system.web>
<
authorization>
<
allow roles="Administrators"/>
<!--
deny users="*"/ -->
</
authorization>
</
system.web>
</
location>
</
configuration>