The resource cannot be found-error

Topics: ASP.NET 2.0
Feb 21, 2009 at 10:40 AM
Hi,
I'm running Blogengine.Net 1.4.5... or trying to at least :)

When I test on my localhost webserver everything works fine, and I can edit, delete new posts etc.

But when I upload it to my actual webserver and try to create a new post, I get errors these errors:

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /post/test.aspx


I can log in and change settings on the blog, no problem...
And I've made sure that the IIS_User has the right write/read etc permissions on the App_Data folder....
Any ideas what could be wrong?




Feb 21, 2009 at 3:25 PM
btw this is the web.config that I am using

<?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="XmlBlogProvider">
            <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=MySQLServer;User ID=user;Password=password;persist security info=False;initial catalog=BlogEngine;" 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>
        <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>
    

    </system.web>
<system.webServer>
<modules>
<remove name="Profile" />
<remove name="AnonymousIdentification" />
<add name="UrlRewrite" type="BlogEngine.Core.Web.HttpModules.UrlRewrite" preCondition="managedHandler" />
<add name="CompressionModule" type="BlogEngine.Core.Web.HttpModules.CompressionModule" preCondition="managedHandler" />
<add name="ReferrerModule" type="BlogEngine.Core.Web.HttpModules.ReferrerModule" preCondition="managedHandler" />
<add name="WwwSubDomainModule" type="BlogEngine.Core.Web.HttpModules.WwwSubDomainModule" preCondition="managedHandler" />
</modules>
<handlers>
<add name="js.axd_" path="js.axd" verb="" type="BlogEngine.Core.Web.HttpHandlers.JavaScriptHandler" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="blogml.axd_" path="blogml.axd" verb="" type="BlogEngine.Core.Web.HttpHandlers.BlogMLExportHandler" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="monster.axd_" path="monster.axd" verb="" type="BlogEngine.Core.Web.HttpHandlers.MonsterHandler" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="opml.axd_" path="opml.axd" verb="" type="BlogEngine.Core.Web.HttpHandlers.OpmlHandler" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="rating.axd_" path="rating.axd" verb="" type="BlogEngine.Core.Web.HttpHandlers.RatingHandler" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="css.axd_" path="css.axd" verb="" type="BlogEngine.Core.Web.HttpHandlers.CssHandler" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="rsd.axd_" path="rsd.axd" verb="" type="BlogEngine.Core.Web.HttpHandlers.RsdHandler" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="metaweblog.axd_" path="metaweblog.axd" verb="" type="BlogEngine.Core.API.MetaWeblog.MetaWeblogHandler" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="opensearch.axd_" path="opensearch.axd" verb="" type="BlogEngine.Core.Web.HttpHandlers.OpenSearchHandler" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="pingback.axd_" path="pingback.axd" verb="" type="BlogEngine.Core.Web.HttpHandlers.PingbackHandler" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="trackback.axd_" path="trackback.axd" verb="" type="BlogEngine.Core.Web.HttpHandlers.TrackbackHandler" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="sitemap.axd_" path="sitemap.axd" verb="" type="BlogEngine.Core.Web.HttpHandlers.SiteMap" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="syndication.axd_" path="syndication.axd" verb="" type="BlogEngine.Core.Web.HttpHandlers.SyndicationHandler" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="image.axd_" path="image.axd" verb="" type="BlogEngine.Core.Web.HttpHandlers.ImageHandler" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="file.axd_" path="file.axd" verb="" type="BlogEngine.Core.Web.HttpHandlers.FileHandler" preCondition="integratedMode,runtimeVersionv2.0" />
</handlers>
<validation validateIntegratedModeConfiguration="false" />
<security>
<authentication>
<basicAuthentication enabled="false" />
</authentication>
</security>
<defaultDocument>
<files>
<clear />
<add value="default.aspx" />
</files>
</defaultDocument>
<httpRedirect enabled="false">
<clear />
</httpRedirect>
</system.webServer>
</configuration>

Coordinator
Feb 21, 2009 at 5:14 PM
Is your webserver using IIS6 or IIS7?

It it's using IIS7, try replacing the <system.webServer> section of your web.config file with the one below to see if it makes any difference.

Also, if you're on IIS7, is the application pool for your website using integrated mode or the classic mode?  In IIS7, you can see what app pool it's using by selecting your website in IIS7, and on the right side is a "Basic Settings..." link.  Clicking on that will show you what Application Pool you're on.  It'll probably either by DefaultAppPool (which we want) or Classic .Net AppPool.

If you're on IIS6, then you won't need the <system.webServer> section.  Instead, you would need the <httpHandlers> and <httpModules> sections that can be found in the web.config file in any BE download.  There's also an option (a checkbox) in IIS6 for the different file extensions to indicate whether the file has to physically exist on disk or not.  You would want to have this unchecked for the ASPX and AXD file extensions.

<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    
    <modules>
        <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" />
    </modules>

    <handlers accessPolicy="Read, Write, Script, Execute">
        <remove name="PageHandlerFactory-Integrated" />
        <add name="FileHandler" verb="*" path="file.axd" type="BlogEngine.Core.Web.HttpHandlers.FileHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" />
        <add name="ImageHandler" verb="*" path="image.axd" type="BlogEngine.Core.Web.HttpHandlers.ImageHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" />
        <add name="Syndication" verb="*" path="syndication.axd" type="BlogEngine.Core.Web.HttpHandlers.SyndicationHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" />
        <add name="Sitemap" verb="*" path="sitemap.axd" type="BlogEngine.Core.Web.HttpHandlers.SiteMap, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" />
        <add name="Trackback" verb="*" path="trackback.axd" type="BlogEngine.Core.Web.HttpHandlers.TrackbackHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" />
        <add name="Pingback" verb="*" path="pingback.axd" type="BlogEngine.Core.Web.HttpHandlers.PingbackHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" />
        <add name="OpenSearch" verb="*" path="opensearch.axd" type="BlogEngine.Core.Web.HttpHandlers.OpenSearchHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" />
        <add name="MetaWeblog" verb="*" path="metaweblog.axd" type="BlogEngine.Core.API.MetaWeblog.MetaWeblogHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" />
        <add name="RSD" verb="*" path="rsd.axd" type="BlogEngine.Core.Web.HttpHandlers.RsdHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" />
        <add name="CssHandler" verb="*" path="css.axd" type="BlogEngine.Core.Web.HttpHandlers.CssHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" />
        <add name="Javascript" path="js.axd" verb="*" type="BlogEngine.Core.Web.HttpHandlers.JavaScriptHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" />
        <add name="Rating" verb="*" path="rating.axd" type="BlogEngine.Core.Web.HttpHandlers.RatingHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" />
        <add name="Opml" verb="*" path="opml.axd" type="BlogEngine.Core.Web.HttpHandlers.OpmlHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" />
        <add name="BlogML" verb="*" path="blogml.axd" type="BlogEngine.Core.Web.HttpHandlers.BlogMLExportHandler, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" />
        <add name="SIOC" verb="*" path="sioc.axd" type="BlogEngine.Core.Web.HttpHandlers.Sioc, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" />
        <add name="Apml" verb="*" path="apml.axd" type="BlogEngine.Core.Web.HttpHandlers.Apml, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" />
        <add name="Foaf" verb="*" path="foaf*.axd" type="BlogEngine.Core.Web.HttpHandlers.Foaf, BlogEngine.Core" resourceType="Unspecified" requireAccess="Script" />
        <add name="PageHandlerFactory-Integrated" path="*.aspx" verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.PageHandlerFactory" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
    </handlers>
</system.webServer>
Feb 21, 2009 at 7:22 PM
Ah...
It turned out my webhotel was not running IIS7...
an upload of web.config for IIS 6 solved the issue..
thnx for the help :)