Web Page rendered with no style... White background with black letters. Also "Details" returns "The resource cannot be found"

258 views
Skip to first unread message

Bob Trueheart

unread,
Apr 17, 2013, 10:57:55 AM4/17/13
to el...@googlegroups.com
MS Server 2012
Using MS Access database.

James_2JS

unread,
Apr 17, 2013, 11:48:24 AM4/17/13
to el...@googlegroups.com
Hi Bob,

Looks like a config problem.
Was this a self-install, or did you use the NuGet packages??
If the former, you might want to try the NuGet packages :O)

Either way, can you post the relevant parts of your web.config please?

Cheers,

James

Bob Trueheart

unread,
Apr 17, 2013, 12:17:40 PM4/17/13
to el...@googlegroups.com
Hi James,

Using .Net Framework Version 4.0.30319

Self Install:
Worked well under MS Server 2008 R2
Migrated to MS Server 2012 and the problem started.

Tried the NuGet package but had the same results.

Thanks for your time.

 <configSections>
        <sectionGroup name="elmah">
            <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
            <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
            <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
            <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
        </sectionGroup>
    </configSections>
   
     <connectionStrings>
        <add name="ConnElmah" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\WWW\App_Data\Elmah.mdb" />
        <add name="BobGIConnectionString" connectionString="server=GServer2012;User Id=WebUser;password=M2wsrw7.;Persist Security Info=True;database=gi" providerName="MySql.Data.MySqlClient" />
    </connectionStrings>
   
      <elmah>
        <security allowRemoteAccess="1" />
        <errorLog type="Elmah.AccessErrorLog, Elmah" connectionStringName="ConnElmah" />
      </elmah>
     
    <system.web>
      <pages validateRequest="true" controlRenderingCompatibilityVersion="4.5" clientIDMode="Static">
            <controls>
                <add tagPrefix="cc1" namespace="CaptchaControl" />
            </controls>
      </pages>
     
      <customErrors mode="Off" />
        <httpModules>
            <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
            <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
            <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
        </httpModules>
    </system.web> 
   
    </system.webServer>
        <modules>
            <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
            <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
            <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
        </modules>
    </system.webServer>   
     
    <location path="Directory">
        <system.web>
            <httpHandlers>
                <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
            </httpHandlers>
        </system.web>
        <system.webServer>
            <handlers>
                <add name="Elmah" path="elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
            </handlers>
        </system.webServer>
    </location> 
     
    <location path="elmah.axd" >
        <system.web>
            <httpHandlers>
                <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
            </httpHandlers>
        </system.web>
        <system.webServer>
            <handlers>
                <add name="ELMAH" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
            </handlers>
        </system.webServer>
    </location> 

James_2JS

unread,
Apr 17, 2013, 12:34:24 PM4/17/13
to el...@googlegroups.com
Thanks Bob!

Interesting!
Can you confirm how you are accessing ELMAH... e.g. http://myserver.com/elmah.axd or http://myserver.com/elmah.axd?
And can you do a View Source on the resulting page and pull out the link to the stylesheet please?

Cheers,

James

Bob Trueheart

unread,
Apr 17, 2013, 1:08:10 PM4/17/13
to el...@googlegroups.com
Hi James,

Style Sheet:
<link rel="stylesheet" type="text/css" href="/AdminDirectory/elmah.axd/stylesheet" />

The "AdminDirectory" is secured by Authenication.

Accessing:
https://Server2012.com/AdminDirectory/elmah.axd/

Thanks


On Wednesday, April 17, 2013 9:57:55 AM UTC-5, Bob Trueheart wrote:

Atif Aziz

unread,
Apr 17, 2013, 3:59:31 PM4/17/13
to el...@googlegroups.com
Bob, is this an ASP.NET plain vanilla, WebForms, MVC 3/4 or WebPages 1/2 web site?

- Atif


--
You received this message because you are subscribed to the Google Groups "ELMAH" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elmah+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

James_2JS

unread,
Apr 17, 2013, 4:16:49 PM4/17/13
to el...@googlegroups.com
Hi Bob,

Looks like there's an inconsistency here.
Your web.config specifies a location of "Directory" and "elmah.axd", yet you are using "AdminDirectory"
Perhaps this is the reason?

You should secure elmah.axd in the location element as per the example here: https://code.google.com/p/elmah/wiki/SecuringErrorLogPages

Hope this helps!

Cheers,

James

Bob Trueheart

unread,
Apr 17, 2013, 7:50:03 PM4/17/13
to el...@googlegroups.com
Hi James,

I found the problem... Yeah!

I added a rewrite rule to insert a "/" at the end of directory request.
In the old days this was the proper way to access a directory and IIS would respond with the configured file.

I have verified that this broke Elmah.

Side Note: The inconsistency in directories was my error... just hiding the real directory names.

I am very sorry to take up your time with my errors.

Thank you for your responses and your time.
-Bob-

The rewrite rule Not to use:
<rule name="Add slash to End" stopProcessing="true">
                    <match url="(.*[^/])$" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Redirect" redirectType="Permanent" url="{R:1}/" />
                </rule>


On Wednesday, April 17, 2013 9:57:55 AM UTC-5, Bob Trueheart wrote:

Atif Aziz

unread,
Apr 18, 2013, 1:24:16 PM4/18/13
to el...@googlegroups.com
Hi Bob,

I took a fresh install Windows Server 2012, added the web server role and ASP.NET 3.5 and 4.0 application development features. I then dropped a plain vanilla MVC app with ELMAH NuGet package and it worked right away without any styling or details pages 404 issues. I'm curious how you came about to what worked for you. Are you sure there's no other component in the app or your installation interfering with routing or interpretation of paths?


--

Bob Trueheart

unread,
Apr 18, 2013, 3:52:35 PM4/18/13
to el...@googlegroups.com
Hi Atif,

This App is Not an MVC App

All was going well with Server 2008 R2.

I moved my existing app to Server 2012
Elmah would not load.
Downloaded ELMAH-1-2-sp2-bin-x64.zip
Updated references for Elmah from the zip file.
Elmah started working, but there was No styling... white background with black characters, also no grid formatting.
Also, none of the page links worked, download,etc. They all returned "The resource cannot be found".

The solution:
I made various modifications to  the root web.config then retested Elmah.
The one I found that enabled Elmah to work normally was a <rewrite> rule (see rule below).
I use <rewrite> <rule> 's to force Https, etc
I had added a rule that inserted a trailng "/" (slash) on directory request(IIS would redirect to default setting). In the old days a trailing slash was normal for bookmarks to work properly.

The trailing "/" turned out to be the problem.
I enabled/disabled the <rule> to verify this was indeed the problem.
When it was "enabled" Elmah failed the style formatting and the links inside Elmah failed.
When it was "disabled" Elmah worked perfectly.

I did this a number of times to test the problem. It acted like an on/off switch for Elmah.

Hopefully I have explained this properly.

I've been using Elmah for a while and really like what it does.

Thanks

-Bob-

The rewrite rule Not to use:
<rule name="Add slash to End" stopProcessing="true">
                    <match url="(.*[^/])$" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Redirect" redirectType="Permanent" url="{R:1}/" />
 </rule>

Atif Aziz

unread,
Apr 18, 2013, 4:22:56 PM4/18/13
to el...@googlegroups.com
Hi Bob,

I also tested with all flavours of ASP.NET applications and could not reproduce your issue. I don't think it's a breaking change with IIS 8 but thanks nonetheless for dropping in with your notes and observations. Glad to hear that it's all sorted out in the end.

- Atif
Reply all
Reply to author
Forward
0 new messages