Pages are renderring incorrectly in build 2.2.8.1

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.
1/2/2009 5:19:17 PM
Gravatar
Total Posts 12

Pages are renderring incorrectly in build 2.2.8.1

Build: 2.2.8.1

Host: GoDaddy

IIS version: 7.0

Trust Policy: Medium Trust

Since the hosting policy at GoDaddy forces medium trust, I had to installl MP using the Medium Trust settings (as outlined in the MP documentation).

After following all the steps, including copying the skin files from Data/Sites/1/skins/styleshout-techmania/ to App_Themes/Default, pages aren't being renderred correctly. Specifically, the font is very large and the link at the top right hand corner of the page are missing.

I've spent close to two days debugging this issue but I've made no progress. Alas, I can't attach a screenshot to show the behavior. You can see the repro at http://www.octomino.com

Thanks in advance.

1/2/2009 5:27:58 PM
Gravatar
Total Posts 18439

Re: Pages are renderring incorrectly in build 2.2.8.1

The url for your css is giving an error:

Paste this in the browser and you will see the error page:

http://www.octomino.com/Data/Sites/1/skins/styleshout-techmania/csshandler.ashx?skin=styleshout-techmania&config=style.config&add=

I would look in the error log under (key icon) Administration Menu > System Log or download the file /Data/currentlog.config, only the last error at the bottom is of interest so please don't post a lot of your log if you decide to post it, just the last one at the bottom.

In IIS 7 the default application pool is "Integrated" which is new in IIS 7, but you need "Classic" so look around in your web control panel for an option like that or ask your host if its available.

Hope it helps,

Joe

1/2/2009 5:46:50 PM
Gravatar
Total Posts 12

Re: Pages are renderring incorrectly in build 2.2.8.1

Thanks for the quick response Joe.

Here is the last entry from the log file. I was expecting this exception since the System.Web.AspNetHostingPermission failed due to Medium Trust. By copying the skin files to App_Themes/Default, I was hoping to workaround this issue.

2009-01-02 16:41:27,408 ERROR mojoPortal.Web.Global - 98.111.74.110-en-US - /Data/Sites/1/skins/styleshout-techmania/csshandler.ashx?skin=styleshout-techmania&config=style.config&add=
System.Web.HttpException: The file '/Data/Sites/1/skins/styleshout-techmania/csshandler.ashx' 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.UI.SimpleHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.UI.SimpleHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path)
at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
 

1/2/2009 5:54:57 PM
Gravatar
Total Posts 18439

Re: Pages are renderring incorrectly in build 2.2.8.1

Its actually true that the file does not exist, there is no physical file csshandler.ashx but it should not throw a 404 not found error.

Make sure you have this in the httpHandlers section of your Web.config file:

<add verb="*" path="*csshandler.ashx" type="mojoPortal.Web.UI.CssHandler, mojoPortal.Web" />

with this mapping the file does not need to exist.

If that does exist in Web.config and you get this error then I think your application pool is configured as "Integrated" and as I've said it needs to be "Classic".

Hope it helps,

Joe

1/2/2009 6:01:07 PM
Gravatar
Total Posts 12

Re: Pages are renderring incorrectly in build 2.2.8.1

Yep, that entry exists in the web.config file.

Here's hoping that GoDaddy has enough flexibility to allow me to change the app pool config :)

Thanks again.

1/2/2009 6:04:45 PM
Gravatar
Total Posts 18439

Re: Pages are renderring incorrectly in build 2.2.8.1

Let me know how it goes. As it happens, we've recently got past a barrier to working in Integrated mode and may be able to support that mode soon, but the 2.2.8.1 release definitely needs Classic.

Best,

Joe

1/2/2009 7:11:57 PM
Gravatar
Total Posts 12

Re: Pages are renderring incorrectly in build 2.2.8.1

Wow, GoDaddy sure doesn't want you to mess around with the IIS settings. The app pool settings are completely buried. I finally changed the pipeline from Integrated to Classic.

Unfortuantely, the site is now consistently giving me the following error message. The log file doesn't provide any clues.

We're sorry but a server error has occurred while trying to process your request.

The error has been logged and will be reviewed by our staff as soon as possible. It is possible that the error was just a momentary hiccup and you may wish to use the back button and try again or go back to the home page.

Last entry in currentlog.config

2009-01-02 18:02:52,050 INFO mojoPortal.Web.Global - Application Started.
2009-01-02 18:02:52,065 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
 

1/2/2009 7:17:10 PM
Gravatar
Total Posts 18439

Re: Pages are renderring incorrectly in build 2.2.8.1

That particular error is logged but it is handled in medium trust and it only happens in application_start event, its just that the error handler logs it, thats why you see the part about "must be running in medium trust.

Look for another error that may be relevant. Go to the log page and clear the log to reduce noise. then see what error is happening.

Hope it helps,

Joe

ps may not be able to respond again until tomorrow

1/2/2009 8:54:46 PM
Gravatar
Total Posts 12

Re: Pages are renderring incorrectly in build 2.2.8.1

Thanks Joe. I cleared out the currentlog.config file. The only entry in the log file is below. Do you generate any dmp files or other trace files that I can take a look at?

currentlog.config

2009-01-02 19:44:46,744 INFO mojoPortal.Web.Global - Application Started.
2009-01-02 19:44:46,759 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
 

1/3/2009 6:51:14 AM
Gravatar
Total Posts 18439

Re: Pages are renderring incorrectly in build 2.2.8.1

If thats the only error in the log I'm at a loss for ideas. There should be something more in the log.

That error is handled so I don't see how it could be the real error causing you to see the error.htm page on every request unless it means the application start event is firing on every request. If the application is restarting on every request then it is more likely that not enough memory is available to run the app because when an app reaches its memory limit it will recycle so when its constantly recycling it usually because its not able to get enough resources.

Best,

Joe

1/3/2009 6:55:29 AM
Gravatar
Total Posts 18439

Re: Pages are renderring incorrectly in build 2.2.8.1

One thing you might try is disabling the generic eror page temporarily so you can see the error right in the browser.

Do this in Web.config by changing <customErrors mode="RemoteOnly" to <customErrors mode="Off"

Maybe that will shed a little more light.

Best,

Joe

1/3/2009 1:10:33 PM
Gravatar
Total Posts 12

Re: Pages are renderring incorrectly in build 2.2.8.1

Thanks Joe. When I hit the web site this morning, the crash is no longer happening. Unfortunately, we're back at square one, where the page is renderring incorrectly. The good news is that the site is now serving up http://www.octomino.com/Data/Sites/1/skins/styleshout-techmania/csshandler.ashx?skin=styleshout-techmania&amp;config=style.config&amp;add=

Last entry in currentlog.config

2009-01-03 12:02:52,948 INFO mojoPortal.Web.Global - Application Started.
2009-01-03 12:02:52,964 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
 

1/3/2009 2:03:02 PM
Gravatar
Total Posts 18439

Re: Pages are renderring incorrectly in build 2.2.8.1

You are going to see that error every time the application starts. The problem now is not related to any errors if thats all you're seeing.

I would delete all the .css files from the App_Themes/default folder leaving only the theme.css (which has no style in it) and theme.skin file copied from styleshout-techmania or whatever skin you plan to use.

Then clear your browser cache again and I think it will work. I'm pretty sure the rendering problem now is because of the css in the above folder. Its including styletextlarge.css which is what makes everything too big.

Hope it helps,

Joe

1/3/2009 2:26:33 PM
Gravatar
Total Posts 12

Re: Pages are renderring incorrectly in build 2.2.8.1

Fantastic! That seems to have done the trick. Thanks for the great support Joe.

Joe, I'd like to make sure that I understand the root cause of the problem and figure out where I went wrong. Here are my exact steps that I had gone through to get skins to work on Medium Trust:

1. There was an original App_Themes\default folder which had two files 'theme.css' and 'theme.skin'. I had renamed this folder to 'default.orig' for backup.

2. I created a new App_Themes/Default folder and copied all the contents from Data/Sites/1/skins/styleshout-techmania/ to this folder.

My understanding is that this should have worked. Is that correct?

1/3/2009 2:36:28 PM
Gravatar
Total Posts 18439

Re: Pages are renderring incorrectly in build 2.2.8.1

Well my documentation on the medium trust page was incorrect about copying all the skin files, it should have said only the theme.skin file. I've corrected it. There is no problem serving css files from the skin folders in medium trust, its just the theme.skin file that we have to serve from App_Settings/default in medium trust. In full trust our custom VirtualPathProvider can serve the theme.skin file from the skin folder which is ideal so all the files are in one place, but in medium trust it fails to register our VirtualPathProvider at application startup which is the error you see logged but it is a handled error so the application can continue to run.

Any css file included in App_Themes/default will be included in the page which is why we really don't want any css files there with style in it. These css files are lower in the page than the main css so they take precedence if present and just throw off the styling from the skin.

Hope it helps,

Joe

1/3/2009 2:41:43 PM
Gravatar
Total Posts 12

Re: Pages are renderring incorrectly in build 2.2.8.1

Great, thanks. It makes perfect sense now why I was seeing the previous behavior.

1/3/2009 3:10:53 PM
Gravatar
Total Posts 12

Re: Pages are renderring incorrectly in build 2.2.8.1

BTW Joe, one last clarification. Is my assumption correct that changing skins in Medium Trust requirest two steps:

1) Change skin using Administration Menu > Site Settings > Skin

2) Copy the theme.skin file that corresponds to the skin in step 1) to the App_Themes/Default folder

Thanks again.

1/3/2009 3:23:42 PM
Gravatar
Total Posts 18439

Re: Pages are renderring incorrectly in build 2.2.8.1

Yes, in general that is the thing to do. However, I will say that we really don't use the theme.skin file for much so in some cases you may not even need to do that unless you see a problem. I've avoided using theme.skin because if you use themes to set style properties the result is that inline styles are generated in the html which makes the page heavier. So I mainly use CSS for everything and theme.skin has only a few different versions across all the skins. There is one technique where I use the theme.skin file for enabling corner rounding where we write some extra divs into the page to create corners with. The corner rounder control that writes the divs is always in the page but in skins without corner rounding we disabled it from theme.skin just to avoid the un-needed extra markup being rendered. So in skins that do use corner rounding css the theme.skin has this:

<mp:CornerRounderTop runat="server"
DoRounding="true"
/>

<mp:CornerRounderBottom runat="server"
DoRounding="true"
/>

whereas in others this is set to false.

Note that the inclusion of the extra divs is not sufficient ther eis css applied to those divs to produce the rounded corners, so just setting this to tru will not create rounded corners, it just creates the divs we need so css can do it.

Off the top of my head thats about the only thing I "think" will really be affected much by the theme.skin file, so in practice you may actuially be able to change skins and not always have to copy the theme.skin file, but once you've really settled on a skin its probably best to do so.

So, in fact its really actually probably possible to host multiple sites in medium trust (with a fixed ip), the main conflict will be if one of them wants corner rounding and the other doesn't because theme.skin is shared by all sites since the VirtualPathProvider doesn't work.

Hope it helps,

Joe

 

1/3/2009 3:31:20 PM
Gravatar
Total Posts 12

Re: Pages are renderring incorrectly in build 2.2.8.1

Thanks for the detailed clarification. This will come in handy.

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