Themes not loading through css.axd

Dec 17, 2008 at 10:12 AM

When I installed blogengine under default settings everything worked fine. Then when I move to use SQL provider (changed blogProvider defaultProvider="DbBlogProvider", and setup tables using sql script) it lost formatting on the blog.

Even after changing themes the all graphics and formatting was lost.

Turns out when I use SQL blog provider it is calling CSS like so: <link rel="stylesheet" href="/themes/Standard/css.axd?name=style.css&amp;v=1.4.5.0" type="text/css" />
but when I use XML provider I see: <link rel="stylesheet" href="themes/Extensive/style.css" type="text/css" />

With SQL provider previewing themes uses style.css to lik css and it shows up fine.

I'm on IIS 7 integrated mode (not classic).

Is the handler for css.axd not kicking in?
The relevant part of web.config after migrating it to my IIS7 host looks like this:

<handlers>

      <clear />
      <add name="Plesk_Handler_0833165495" path="*.asp" verb="GET,HEAD,POST,TRACE" modules="IsapiModule" scriptProcessor="c:\windows\system32\inetsrv\asp.dll" resourceType="Either" />
      <add name="Plesk_Handler_0833166387" path="*.cer" verb="GET,HEAD,POST,TRACE" modules="IsapiModule" scriptProcessor="c:\windows\system32\inetsrv\asp.dll" resourceType="Either" />
      <add name="Plesk_Handler_0833166388" path="*.asa" verb="GET,HEAD,POST,TRACE" modules="IsapiModule" scriptProcessor="c:\windows\system32\inetsrv\asp.dll" resourceType="Either" />
      <add name="Plesk_Handler_0833166389" path="*.cdx" verb="GET,HEAD,POST,TRACE" modules="IsapiModule" scriptProcessor="c:\windows\system32\inetsrv\asp.dll" resourceType="Either" />
      <add name="Plesk_Handler_0833166392" path="*.ashx" verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.SimpleHandlerFactory" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" />
      <add name="Plesk_Handler_0833166393" path="*.asmx" verb="GET,HEAD,POST,DEBUG" type="System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" />
      <add name="Plesk_Handler_0833166394" path="*.aspx" verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.PageHandlerFactory" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" />
      <add name="Plesk_Handler_0833166400" path="*.rem" verb="GET,HEAD,POST,DEBUG" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" />
      <add name="Plesk_Handler_0833166403" path="*.soap" verb="GET,HEAD,POST,DEBUG" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" />
      <add name="Plesk_Handler_0833166433" path="*.shtm" verb="GET,POST" modules="ServerSideIncludeModule" resourceType="Either" />
      <add name="Plesk_Handler_0833166434" path="*.shtml" verb="GET,POST" modules="ServerSideIncludeModule" resourceType="Either" />
      <add name="Plesk_Handler_0833166435" path="*.stm" verb="GET,POST" modules="ServerSideIncludeModule" resourceType="Either" />
      <add name="Plesk_Handler_0833166436" path="*.php" verb="*" modules="CgiModule" scriptProcessor="c:\program files (x86)\parallels\plesk\additional\php\php.exe" resourceType="Either" />
      <add name="Plesk_Handler_0833166437" path="*.php3" verb="*" modules="CgiModule" scriptProcessor="c:\program files (x86)\parallels\plesk\additional\php\php.exe" resourceType="Either" />
      <add name="Plesk_Handler_0833166438" path="*.phtml" verb="*" modules="CgiModule" scriptProcessor="c:\program files (x86)\parallels\plesk\additional\php\php.exe" resourceType="Either" />
      <add name="Plesk_Handler_0833166439" path="*.cgi" verb="GET,HEAD,POST" modules="CgiModule" scriptProcessor="c:\program files (x86)\parallels\plesk\additional\perl\bin\perl.exe &quot;%s&quot; %s" resourceType="Either" />
      <add name="Plesk_Handler_0833166441" path="*.pl" verb="GET,HEAD,POST" modules="CgiModule" scriptProcessor="c:\program files (x86)\parallels\plesk\additional\perl\bin\perl.exe &quot;%s&quot; %s" resourceType="Either" />
      <add name="Plesk_Handler_0833166442" path="*.plx" verb="GET,HEAD,POST" modules="IsapiModule" scriptProcessor="c:\program files (x86)\parallels\plesk\additional\perl\bin\perlis.dll" resourceType="Either" />
      <add name="Plesk_Handler_0833166443" path="WebResource.axd" verb="GET,DEBUG" type="System.Web.Handlers.AssemblyResourceLoader" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" />
      <add name="Plesk_Handler_0833166444" path="trace.axd" verb="GET,HEAD,POST,DEBUG" type="System.Web.Handlers.TraceHandler" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" />
      <add name="Plesk_Handler_0833166445" path="WebAdmin.axd" verb="GET,DEBUG" type="System.Web.Handlers.WebAdminHandler" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" />
      <add name="Plesk_Handler_0833166448" path="*.dll" verb="*" modules="IsapiModule" resourceType="File" requireAccess="Execute" allowPathInfo="true" />
      <add name="Plesk_Handler_0833166449" path="*.exe" verb="*" modules="CgiModule" resourceType="File" requireAccess="Execute" allowPathInfo="true" />
      <add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" />
     
     
      <add verb="*" name="handler1" path="file.axd" type="BlogEngine.Core.Web.HttpHandlers.FileHandler, BlogEngine.Core" />
      <add verb="*" name="handler2" path="image.axd" type="BlogEngine.Core.Web.HttpHandlers.ImageHandler, BlogEngine.Core" />
      <add verb="*" name="handler3" path="syndication.axd" type="BlogEngine.Core.Web.HttpHandlers.SyndicationHandler, BlogEngine.Core" />
      <add verb="*" name="handler4" path="sitemap.axd" type="BlogEngine.Core.Web.HttpHandlers.SiteMap, BlogEngine.Core" />
      <add verb="*" name="handler5" path="trackback.axd" type="BlogEngine.Core.Web.HttpHandlers.TrackbackHandler, BlogEngine.Core" />
      <add verb="*" name="handler6" path="pingback.axd" type="BlogEngine.Core.Web.HttpHandlers.PingbackHandler, BlogEngine.Core" />
      <add verb="*" name="handler7" path="opensearch.axd" type="BlogEngine.Core.Web.HttpHandlers.OpenSearchHandler, BlogEngine.Core" />
      <add verb="*" name="handler8" path="metaweblog.axd" type="BlogEngine.Core.API.MetaWeblog.MetaWeblogHandler, BlogEngine.Core" />
      <add verb="*" name="handler9" path="rsd.axd" type="BlogEngine.Core.Web.HttpHandlers.RsdHandler, BlogEngine.Core" />
      <add verb="*" name="handler10" path="css.axd" type="BlogEngine.Core.Web.HttpHandlers.CssHandler, BlogEngine.Core" />
      <add verb="*" name="handler11" path="js.axd" type="BlogEngine.Core.Web.HttpHandlers.JavaScriptHandler, BlogEngine.Core" />
      <add verb="*" name="handler12" path="rating.axd" type="BlogEngine.Core.Web.HttpHandlers.RatingHandler, BlogEngine.Core" />
      <add verb="*" name="handler13" path="opml.axd" type="BlogEngine.Core.Web.HttpHandlers.OpmlHandler, BlogEngine.Core" />
      <add verb="*" name="handler14" path="blogml.axd" type="BlogEngine.Core.Web.HttpHandlers.BlogMLExportHandler, BlogEngine.Core" />
      <add verb="*" name="handler15" path="sioc.axd" type="BlogEngine.Core.Web.HttpHandlers.Sioc, BlogEngine.Core" />
      <add verb="*" name="handler16" path="apml.axd" type="BlogEngine.Core.Web.HttpHandlers.Apml, BlogEngine.Core" />
      <add verb="*" name="handler17" path="foaf*.axd" type="BlogEngine.Core.Web.HttpHandlers.Foaf, BlogEngine.Core" />
    </handlers>

    <validation validateIntegratedModeConfiguration="false" />
  </system.webServer>



Thanks
Dec 17, 2008 at 10:19 AM

Never mind, I figured it out.
StaticFile handler was kicking in for css, just had to move it down.
Dec 31, 2008 at 9:38 PM
Help!!
I'm suffering from the same symptom but it's only happening when I run BE at my hosting provider in SQLServer mode.  I run XP locally with IIS version 5.1 so I'm not sure if my provider is running IIS 7.0.  But, I'm able to run everything in SQLServer mode locally so I assume (?) IIS 7.0 is not needed to resolve this problem (?).  Even so, I altered the <system.webServer> section of my web.config to match what's above and it didn't seem to help.

Facts:
=======================
1. When running BE with web.config set to <blogProvider defaultProvider="XMLBlogProvider"> themes display correctly. The stylesheet url is:
http://sissonix.com/themes/StableStart/style.css

2. When running BE with web.config set to <blogProvider defaultProvider="DbBlogProvider"> themes DO NOT show up correctly. The stylesheet url is:

http://sissonix.com/themes/TechJunkie/css.axd?name=style.css&v=1.4.5.0
This is yielding a 404 Not Found error.

3. I know my SQLServer connection is good because I can alter a record from the Post table and see the change (note, I haven't changed anything else in the database manually!!).

Any help greatly appreciated.
Mark



Coordinator
Dec 31, 2008 at 10:02 PM
What I'd try first is use the original <system.webServer> section you had from before, but completely remove the <httpHandlers> and <httpModules> sections in your web.config file.  You probably already have the necessary modules and handlers defined within <system.webServer> and there may be a conflict with the <httpHandlers> and <httpModules>.

If that doesn't work, you can try using the <system.webServer> section in this thread.
Dec 31, 2008 at 10:23 PM
Thanks Ben.  I found out that they're hosting my site on a box running IIS6. I assume that means that <system.webServer> is an irrelevant configuration option for me, right?  Nonetheless I returned <system.webServer> back to how it looked out-of-the-box from my first BE download, which means it had nothing in it:

<system.webServer><system.webServer/>

Not sure what to try next - I was going to add some tracing in the CssHandler.cs file and see if that code is even being hit.  Is there a simpler way to check a log file on IIS to understand if CssHandler.cs is handling the request to http://sissonix.com/themes/TechJunkie/css.axd?name=style.css&v=1.4.5.0 ???  I'm just not sure who's at fault for causing a 404 error to get thrown.

Here's my complete config file:
====================================================
<?xml version="1.0"?>
<configuration>
    <configSections>
        <sectionGroup name="BlogEngine">
            <section name="blogProvider" requirePermission="false" type="BlogEngine.Core.Providers.BlogProviderSection, BlogEngine.Core" allowDefinition="MachineToApplication" restartOnExternalChanges="true"/>
        </sectionGroup>
    </configSections>
    <BlogEngine>
        <blogProvider defaultProvider="DbBlogProvider">
            <providers>
                <add name="XmlBlogProvider" type="BlogEngine.Core.Providers.XmlBlogProvider, BlogEngine.Core"/>
                <add name="DbBlogProvider" type="BlogEngine.Core.Providers.DbBlogProvider, BlogEngine.Core" connectionStringName="BlogEngine"/>
            </providers>
        </blogProvider>
    </BlogEngine>
    <!-- configSource is not implemented in Mono.
    <connectionStrings configSource="sql.config" />
  -->
    <connectionStrings>
        <clear/>
        <add name="LocalSqlServer" connectionString="dummy"/>
        <!-- Mono complains if LocalSqlServer isn't specified -->
        <add name="BlogEngine" connectionString="Data Source=ZZZ;User ID=ZZZ;Password=ZZZ;persist security info=False;initial catalog=ZZZ;" providerName="System.Data.SqlClient"/>
    </connectionStrings>
    <appSettings>
        <add key="BlogEngine.FileExtension" value=".aspx"/>
        <!-- You can e.g. use "~/blog/" if BlogEngine.NET is not located in the root of the application -->
        <add key="BlogEngine.VirtualPath" value="~/"/>
        <!-- The regex used to identify mobile devices so a different theme can be shown -->
        <add key="BlogEngine.MobileDevices" value="(nokia|sonyericsson|blackberry|samsung|sec\-|windows ce|motorola|mot\-|up.b|midp\-)"/>
        <!-- The name of the role with administrator permissions -->
        <add key="BlogEngine.AdminRole" value="Administrators"/>
        <!--This value is to provide an alterantive location for storing data.-->
        <add key="StorageLocation" value="~/App_Data/"/>
        <!--A comma separated list of script names to hard minify. It's case-sensitive. -->
        <add key="BlogEngine.HardMinify" value="blog.js,widget.js,WebResource.axd"/>
    </appSettings>
    <system.web>
    <trace enabled="true" pageOutput="true" requestLimit="50" traceMode="SortByTime" />
    <compilation debug="true">
            <assemblies>
                <add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            </assemblies>
        </compilation>
        <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="auto" uiCulture="auto"/>
        <httpRuntime enableVersionHeader="false" useFullyQualifiedRedirectUrl="true" maxRequestLength="16384" executionTimeout="3600" requestLengthDiskThreshold="16384"/>
        <machineKey validationKey="D9F7287EFDE8DF4CAFF79011D5308643D8F62AE10CDF30DAB640B7399BF6C57B0269D60A23FBCCC736FC2487ED695512BA95044DE4C58DC02C2BA0C4A266454C" decryptionKey="BDAAF7E00B69BA47B37EEAC328929A06A6647D4C89FED3A7D5C52B12B23680F4" validation="SHA1" decryption="AES"/>
        <authentication mode="Forms">
            <forms timeout="129600" name=".AUXBLOGENGINE" protection="All" slidingExpiration="true" loginUrl="~/login.aspx" cookieless="UseCookies"/>
        </authentication>
        <pages enableSessionState="false" enableViewStateMac="true" enableEventValidation="true">
            <controls>
                <add namespace="Controls" tagPrefix="blog"/>
            </controls>
        </pages>
        <customErrors mode="Off">
            <error statusCode="404" redirect="~/error404.aspx"/>
        </customErrors>
        <membership defaultProvider="XmlMembershipProvider">
            <providers>
                <clear/>
                <add name="XmlMembershipProvider" type="BlogEngine.Core.Providers.XmlMembershipProvider, BlogEngine.Core" description="XML membership provider" passwordFormat="Hashed"/>
                <add name="SqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="BlogEngine" applicationName="BlogEngine"/>
                <add name="DbMembershipProvider" type="BlogEngine.Core.Providers.DbMembershipProvider, BlogEngine.Core" passwordFormat="Hashed" connectionStringName="BlogEngine"/>
            </providers>
        </membership>
        <roleManager defaultProvider="XmlRoleProvider" enabled="true" cacheRolesInCookie="true" cookieName=".BLOGENGINEROLES">
            <providers>
                <clear/>
                <add name="XmlRoleProvider" type="BlogEngine.Core.Providers.XmlRoleProvider, BlogEngine.Core" description="XML role provider"/>
                <add name="SqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="BlogEngine" applicationName="BlogEngine"/>
                <add name="DbRoleProvider" type="BlogEngine.Core.Providers.DbRoleProvider, BlogEngine.Core" connectionStringName="BlogEngine"/>
            </providers>
        </roleManager>
        <siteMap defaultProvider="PageSiteMap" enabled="true">
            <providers>
                <add name="PageSiteMap" description="The site map provider that reads in the .sitemap XML files." type="BlogEngine.Core.Web.Controls.PageSiteMap, BlogEngine.Core"/>
                <add name="SecuritySiteMap" description="Used for authenticated users." type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" securityTrimmingEnabled="true" siteMapFile="Web.sitemap"/>
            </providers>
        </siteMap>
        <httpModules>
            <add name="WwwSubDomainModule" type="BlogEngine.Core.Web.HttpModules.WwwSubDomainModule, BlogEngine.Core"/>
            <add name="UrlRewrite" type="BlogEngine.Core.Web.HttpModules.UrlRewrite, BlogEngine.Core"/>
            <add name="CompressionModule" type="BlogEngine.Core.Web.HttpModules.CompressionModule, BlogEngine.Core"/>
            <add name="ReferrerModule" type="BlogEngine.Core.Web.HttpModules.ReferrerModule, BlogEngine.Core"/>
            <!--Remove the default ASP.NET modules we don't need-->
            <remove name="PassportAuthentication"/>
            <remove name="Profile"/>
            <remove name="AnonymousIdentification"/>
        </httpModules>
        <httpHandlers>
            <add verb="*" path="file.axd" type="BlogEngine.Core.Web.HttpHandlers.FileHandler, BlogEngine.Core" validate="false"/>
            <add verb="*" path="image.axd" type="BlogEngine.Core.Web.HttpHandlers.ImageHandler, BlogEngine.Core" validate="false"/>
            <add verb="*" path="syndication.axd" type="BlogEngine.Core.Web.HttpHandlers.SyndicationHandler, BlogEngine.Core" validate="false"/>
            <add verb="*" path="sitemap.axd" type="BlogEngine.Core.Web.HttpHandlers.SiteMap, BlogEngine.Core" validate="false"/>
            <add verb="*" path="trackback.axd" type="BlogEngine.Core.Web.HttpHandlers.TrackbackHandler, BlogEngine.Core" validate="false"/>
            <add verb="*" path="pingback.axd" type="BlogEngine.Core.Web.HttpHandlers.PingbackHandler, BlogEngine.Core" validate="false"/>
            <add verb="*" path="opensearch.axd" type="BlogEngine.Core.Web.HttpHandlers.OpenSearchHandler, BlogEngine.Core" validate="false"/>
            <add verb="*" path="metaweblog.axd" type="BlogEngine.Core.API.MetaWeblog.MetaWeblogHandler, BlogEngine.Core" validate="false"/>
            <add verb="*" path="rsd.axd" type="BlogEngine.Core.Web.HttpHandlers.RsdHandler, BlogEngine.Core" validate="false"/>
            <add verb="*" path="css.axd" type="BlogEngine.Core.Web.HttpHandlers.CssHandler, BlogEngine.Core" validate="false"/>
            <add verb="*" path="js.axd" type="BlogEngine.Core.Web.HttpHandlers.JavaScriptHandler, BlogEngine.Core" validate="false"/>
            <add verb="*" path="rating.axd" type="BlogEngine.Core.Web.HttpHandlers.RatingHandler, BlogEngine.Core" validate="false"/>
            <add verb="*" path="opml.axd" type="BlogEngine.Core.Web.HttpHandlers.OpmlHandler, BlogEngine.Core" validate="false"/>
            <add verb="*" path="blogml.axd" type="BlogEngine.Core.Web.HttpHandlers.BlogMLExportHandler, BlogEngine.Core" validate="false"/>
            <add verb="*" path="sioc.axd" type="BlogEngine.Core.Web.HttpHandlers.Sioc, BlogEngine.Core" validate="false"/>
            <add verb="*" path="apml.axd" type="BlogEngine.Core.Web.HttpHandlers.Apml, BlogEngine.Core" validate="false"/>
            <add verb="*" path="foaf*.axd" type="BlogEngine.Core.Web.HttpHandlers.Foaf, BlogEngine.Core" validate="false"/>
        </httpHandlers>
    </system.web>
    <system.codedom>
    </system.codedom>
  <system.webServer>
 </system.webServer>
</configuration>


Coordinator
Dec 31, 2008 at 10:39 PM
Unfortunately, I don't think IIS logs would show whether CssHandler.cs is doing anything.  Also, you're right that if you're on IIS6, then the system.webServer section won't matter.

In the Settings section in the Control Panel, there's an Advance Settings section.  Try unchecking "Trim stylesheets".  Someone mentioned something about that recently, and looking at the code now, it appears that if Trim Stylesheets is checked, then css.axd is used instead of plain old style.css.  If this works, then it's possible the settings in your old XML file had Trim Stylesheets turned off, but the settings in your SQL database has Trim stylesheets turned on.
Jan 1, 2009 at 12:10 AM
Ok, taking off the trim stylesheet flag fixed the styling problem but now I'm seeing other symptoms and I'm starting to lose confidence in BE :<

When I watch the page load in Fiddler I'm seeing the following items get 404 errors when running in SQLServer mode:
1. http://sissonix.com/js.axd?path=%2fblog.js&v=1.4.5.0
2. http://sissonix.com/js.axd?path=%2fadmin%2fwidget.js&v=1.4.5.0
3. http://sissonix.com/WebResource.axd?d=j246orv_38DeKtGbza6y6A2&t=633384756006281250
4. http://sissonix.com/opensearch.axd

I'll start a new thread because this seems like a different issue.  I'm losing a lot of time on this BE app...





Coordinator
Jan 1, 2009 at 12:36 AM
As a quick test, you could try also unchecking "Enable HTTP Compression" under advanced settings.