Hi knoess,
2009-03-16 16:04:11,624 ERROR mojoPortal.Web.mojoBasePage - 77.56.59.125-de-CH - /mojo/fotos-simple.aspx
System.Reflection.TargetInvocationException: Property accessor 'Link' on object 'mojoPortal.Web.Controls.FolderGallery.AlbumFolderInfo' threw the following exception:'The type initializer for 'mojoPortal.Web.Controls.FolderGallery.ImageHelper' threw an exception.' ---> System.TypeInitializationException: The type initializer for 'mojoPortal.Web.Controls.FolderGallery.ImageHelper' threw an exception. ---> System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.IO.Directory.CreateDirectory(String path, DirectorySecurity directorySecurity)
at System.IO.Directory.CreateDirectory(String path)
at mojoPortal.Web.Controls.FolderGallery.ImageHelper..cctor()
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.FileIOPermission
The error seems to indicate insufficient permission to create the folder /Data/systemfiles/FolderGalleryCache
Its attempting to create it in the constructor of ImageHelper
if (Caching == ImageCacheLocation.Disk)
{
if (
(HttpContext.Current != null)
&&(ConfigurationManager.AppSettings["FolderGalleryCachePath"] != null)
)
{
string baseDir = HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["FolderGalleryCachePath"]);
_imageCacheDir = Path.Combine(baseDir, "FolderGalleryCache");
}
else
{
_imageCacheDir = Path.Combine(HttpRuntime.CodegenDir, "Album");
}
Directory.CreateDirectory(_imageCacheDir);
_appPath = HttpRuntime.AppDomainAppPath;
if (_appPath[_appPath.Length - 1] == '\\')
{
_appPath = _appPath.Substring(0, _appPath.Length - 1);
}
}
I believe the line where it throws this exception is:
Directory.CreateDirectory(_imageCacheDir);
So it seems clear the web process cannot create this folder, it does not have permission. So the solution must be to give it permission to create folders beneath /Data/systemfiles
I will add code there in the next release to check if the directory exists first so that we can possibly avoid this error if the folder is created manually.
Hope it helps,
Joe