Security Exception - Multiple Blogs on 1and1 hosting.

Topics: ASP.NET 2.0
Apr 5, 2008 at 2:19 PM
Edited Apr 6, 2008 at 6:16 PM
Scratch my past request. I realized that you CAN configure multiple applications under my 1and1 hosting package. But now I am running into exceptions:

I have a hosting package with 1and1. The root of my webspace is configured as an application in IIS. What I would like to be able to do is set up BE.Net in this environment as described below:

\ <-- Application in IIS
\blogs <- Virt. Dir
\blogs\Blog1 <- Application
\blogs\Blog2 <- Application

Everything looked good when I moved Blog1 up.

When I moved Blog2 up and made it an application I have started getting intermittent security exceptions:
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.GetConfigPathData(String configPath) +243
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) +3379642
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
admin_menu.BindMenu() +58
adminmenu.PageLoad(Object sender, EventArgs e) +31
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Control.LoadRecursive() +131
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.defaultaspx.ProcessRequest(HttpContext context) in AppWeb_ju6uov5y.1.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

Note that to get things running on 1and1 I had to remove the High trust line from the web.config. I also had to change the AddBlog method in App_Code/Controls/BlogRoll.cs to wrap the request for the DefaultNetworkCreds in a Try/Catch.

The stack trace doesn't really mean anything to me since nearly all of it is in the framework code.

Are there any configuration precautions to take when running multiple instances of BE.NET?

Thanks!
Apr 6, 2008 at 9:07 PM
Update. I have deleted everything and only moved Blog1 up. I am still seeing the exception sporadically.

Looking more closely at the stack trace I see the error is coming from the admin_menu BindMenu method. Any idea why processing the Admin site map would be causing an issue?
Apr 7, 2008 at 1:26 AM
Upon looking at the WorkItems I see a closed issue detailing the same problem: http://www.codeplex.com/blogengine/WorkItem/View.aspx?WorkItemId=5033

While it is marked closed the resolution provided did not solve the issue for another user or myself.

thanks!