Image gallery error

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
2/26/2009 4:31:17 PM
Gravatar
Total Posts 16

Image gallery error

I am getting the following error when trying to view a page that has the image gallery option on.

2009-02-26 14:46:19,823 INFO mojoPortal.Web.Global - Application Started.
2009-02-26 14:46:19,839 ERROR mojoPortal.Web.Global - Application_Start Could not register VirtualPathProvider, must be running in Medium trust or lower
System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object assemblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Object assemblyOrString, SecurityAction action, Boolean throwException)
at System.Security.CodeAccessSecurityEngine.CheckSetHelper(CompressedStack cs, PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Assembly asm, SecurityAction action)
at mojoPortal.Web.Global.RegisterVirtualPathProvider()
at mojoPortal.Web.Global.Application_Start(Object sender, EventArgs e)
The action that failed was:
InheritanceDemand
The type of the first permission that failed was:
System.Web.AspNetHostingPermission
The Zone of the assembly that failed was:
MyComputer

2/26/2009 4:34:16 PM
Gravatar
Total Posts 18439

Re: Image gallery error

Hi,

You are running in Medium Trust, did you follow the steps in this page?

http://www.mojoportal.com/mediumtrust.aspx

Hope it helps,

Joe

2/27/2009 12:16:09 PM
Gravatar
Total Posts 16

Re: Image gallery error

You did it!

I did previously look at the article and ignored a very important step. Allow write access to app_data\NeatUpload_Temp.

Thank you very much :). I am not a huge fan of godaddy but I use them. Feel free to chop the rest of the post.

For other godaddy hosting users I would like to "contribute" with my messy installation notes:

Have a Windows Deluxe hosting account

Copy your wwwroot mojoportal files to any folder it does not have to be root, a folder named mojoportal would
be nice :)

Upload using filezilla so you would know if any files had problems, its 8000 files strong and the built in
FTP client for Dreamweaver will take forever and you might never know what was uploaded or not.

Log on to godaddy.com and find your HOSTING CONTROL CENTER, click on YOUR FILES, on the right hand side put a
checkmark on your Data folder and select the permissions icon on the top. Uncheck Inherit and check write.
Very Important - put a check on Reset all children to inherit. then clik ok. Do the same to the folder
located the NeatUpload folder located on app_data\NeatUpload_Temp.

Setup a MS SQL database on godaddy sorry I dont describe how.
Look for MSSQLConnectionString on the Web.config file and change it with your information it would look close
to this:
<add key="MSSQLConnectionString"
value="server=yourname.db.3888244.hostedresource.com;UID=username;PWD=password;database=username" />

Next step is medium trust:
1.Rename Web.config file to Web.fulltrust.config
2.Rename Web.mediumtrust.config to Web.config
3.Delete DotNetOpenId.dll from the /bin folder
4.Make sure and visit your /Setup/Default.aspx page, it should tell you a setting you need to add to
Web.config for the search engine to get around a medium trust issue.
http://www.mojoportal.com/mediumtrust.aspx

After setting your connection string and uploading the edited file, visit the web page at
http://yoursiterootordomainname/Setup/Default.aspx and mojoportal setup will proceed with installing the
tables and other database obejcts into your database.

After the installation you will get a message with something like this
In order for the Search Engine to work in Medium trust, you need to add this in Web.config in the AppSettings
section:

<add key="Lucene.Net.lockdir" value="D:\Hosting\3888244\html\birmiami\Data\Sites\1\index" />
do it.

Go to your home page.

2/27/2009 4:46:07 PM
Gravatar
Total Posts 16

Now I have a Simple folder gallery error

They all look security related. I am sure there are more folders that need write access. Here is my error

2009-02-26 14:46:19,823 INFO mojoPortal.Web.Global - Application Started.
2009-02-26 14:46:19,839 ERROR mojoPortal.Web.Global - Application_Start Could not register VirtualPathProvider, must be running in Medium trust or lower
System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object assemblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Object assemblyOrString, SecurityAction action, Boolean throwException)
at System.Security.CodeAccessSecurityEngine.CheckSetHelper(CompressedStack cs, PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Assembly asm, SecurityAction action)
at mojoPortal.Web.Global.RegisterVirtualPathProvider()
at mojoPortal.Web.Global.Application_Start(Object sender, EventArgs e)
The action that failed was:
InheritanceDemand
The type of the first permission that failed was:
System.Web.AspNetHostingPermission
The Zone of the assembly that failed was:
MyComputer
2009-02-26 14:46:21,274 INFO mojoPortal.Web.WebTaskManager - deserialized WebTaskManager task
2009-02-26 14:46:21,274 INFO mojoPortal.Web.WebTaskManager - Queued WebTaskManager on a new thread
2009-02-26 14:46:21,321 ERROR mojoPortal.Web.Global - 66.176.137.121-en-US - /birmiami
System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string.
Parameter name: startIndex
at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at mojoPortal.Web.UrlRewriter.RewriteUrl(HttpApplication app)
at mojoPortal.Web.UrlRewriter.UrlRewriter_BeginRequest(Object sender, EventArgs e)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
2009-02-26 14:46:21,570 INFO mojoPortal.Business.WebHelpers.IndexWriterTask - deserialized IndexWriterTask task
2009-02-26 14:46:21,570 INFO mojoPortal.Business.WebHelpers.IndexWriterTask - Queued IndexWriterTask on a new thread
2009-02-26 14:46:29,043 ERROR mojoPortal.Web.UI.Pages.SiteHome - 66.176.137.121 - Error setting master page. Will try settingto default skin
System.Web.HttpException: The file '/birmiami/Data/Sites/1/skins/valzero-birmiami/layout.Master' does not exist.
at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection)
at System.Web.UI.Page.get_Master()
at mojoPortal.Web.UI.Pages.SiteHome.SetupMasterPage()
at mojoPortal.Web.UI.Pages.SiteHome.OnPreInit(EventArgs e)

2/28/2009 1:09:28 PM
Gravatar
Total Posts 18439

Re: Image gallery error

None of these errors appear related to the folder gallery. The first error, you will see it logged every time the application_start event fires because it can't use the VirtualPathProvider in medium trust, its an expected error and is handled and logged. The other errors are not related.

I'm not 100% sure if the Folder Gallery can work in Medium Trust but my recollection is that it did work for me. I would have to test it again to know for sure, if I get a chance in the next few days I'll try it.

Best,

Joe

3/1/2009 9:58:13 AM
Gravatar
Total Posts 18439

Re: Image gallery error

I just tested folder gallery here and it works fine for me in medium trust.

The /Data folder must be completely writable so new folders and files can be added by the code.

Really what you should do is organize pictures into a folder(s) on your local machine, then ftp the folder(s) into this folder:
/Data/Sites/[SiteID]/FolderGalleries/

It will create thumbnails in /Data/systemfiles/FolderGalleryCache

The thumbnails will be created automatically the first time you visit the page with the folder gallery on it.

Hope it helps,

Je

3/3/2009 11:06:07 AM
Gravatar
Total Posts 16

Re: Image gallery error

I can provide you with full ftp access if you like. I am unable to deploy the site on schedule anyways. Also I can help document the installation and I would like to send a list of petty fragments like today's date, random fact, and others I put toguether that I am sure users would appreciate.

Here is the link of the site http://www.brickellinvestmentrealty.com/birmiami/ that shows an error but if you visit like this http://www.brickellinvestmentrealty.com/birmiami/default.aspx it does not. I am sorry if I am not using the forum properly.

3/5/2009 6:12:45 AM
Gravatar
Total Posts 18439

Re: Image gallery error

Hi,

I don't see any different between the 2 urls when I view them.

If you have any fragments you would like to share you can send me a .zip and description of each fragment and I will make them available on the community downloads page.

If you are still experiencing any errors, one thing that could be a factor is that you have a different ASP.NET app running in the root of the site, sometimes there can be conflicts between Web.config file in mojoPortal and the one in the root folder.

Best,

Joe

3/5/2009 9:29:56 AM
Gravatar
Total Posts 16

Re: Image gallery error

The fragments are a brilliant approach. Thanks to that I can use includes. Your whole application is amazing. Where do I send my fragments to?

3/5/2009 11:42:03 AM
Gravatar
Total Posts 18439

Re: Image gallery error

oops forgot, you can send to me at joe dot audette at g mail dotcom

Best,

Joe 

3/16/2009 7:51:11 PM
Gravatar
Total Posts 5

Re: Image gallery error

Hi Joe,

fist off all thanks for the cool portal ....

I'm also try to install a site on godaddy to get the mojo Portal running, I'm thinking I'm at the same stage like Valzero, did the same same steps, exept the Lucene.Net.lockdir entry, which I din't change so far. However beside the VirtualPathProvider-exception, I have also the following enty. the upload is working, also the other gallery (writing into the GalleryImages is working), the error is in the case that some images are in FolderGalleries and I thing it while they want to create the thumbnails (in the GalleryImages where created succesfully) ... do you have any ideas.

@Valzero: thanks for the detailed descriptions of the steps, which I have done independently. Did you get the FolderGalleries running in the meantime? You portal look really good.

BR
Volker
Here my exeption:

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 Zone of the assembly that failed was:
MyComputer
--- End of inner exception stack trace ---
at mojoPortal.Web.Controls.FolderGallery.ImageHelper.JScriptEncode(String unencoded)
at mojoPortal.Web.Controls.FolderGallery.AlbumPageInfo.get_Link()
--- End of inner exception stack trace ---
at System.ComponentModel.ReflectPropertyDescriptor.GetValue(Object component)
at System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName)
at System.Web.UI.DataBinder.Eval(Object container, String[] expressionParts)
at System.Web.UI.DataBinder.Eval(Object container, String expression)
at System.Web.UI.TemplateControl.Eval(String expression)
at ASP.foldergallery_foldergallerymodule_ascx.__DataBinding__control9(Object sender, EventArgs e)
at System.Web.UI.Control.OnDataBinding(EventArgs e)
.....
at mojoPortal.Web.mojoBasePage.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
2009-03-16 16:04:11,827 ERROR mojoPortal.Web.Global - 77.56.59.125-de-CH - /mojo/fotos-simple.aspx
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 Zone of the assembly that failed was:
MyComputer
--- End of inner exception stack trace ---
at mojoPortal.Web.Controls.FolderGallery.ImageHelper.JScriptEncode(String unencoded)
at mojoPortal.Web.Controls.FolderGallery.AlbumPageInfo.get_Link()
 

You must sign in to post in the forums. This thread is closed to new posts.