Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 29th, 2006, 10:32 PM
Registered User
 
Join Date: Jul 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Wrox Blog - error message runtime

Dear Sir,
    After I setup the Wrox Blog from chapter 6 but i got error msg

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed.

Details: To enable the details of this specific error message to be viewable on the local server machine, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "RemoteOnly". To enable the details to be viewable on remote machines, please set "mode" to "Off".




<configuration>
    <system.web>
        <customErrors mode="RemoteOnly"/>
    </system.web>
</configuration>

Then i change to "Off" from "On" <customErrors mode="RemoteOnly"/>

again error saying
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: The entry 'SqlProvider' has already been added.

Source Error:


Line 61: defaultProvider="SqlProvider">
Line 62: <providers>
Line 63: <add connectionStringName="SqlServerConnectionString" name="SqlProvider"
Line 64: type="System.Web.Security.SqlRoleProvider" />
Line 65: </providers>

Pretty messy up with error repeat and repeat please help and fix it up with debugging program to be correct code..

Thank for help
Highspeedwire



jeff
 
Old July 30th, 2006, 03:31 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Can you post the entire code for the web.config file?

And can you confirm from the error message that you're running against the 2.0 version of the framework? There should be a version number listed at the bottom....

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old July 30th, 2006, 12:26 PM
Registered User
 
Join Date: Jul 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I post the web.config of Wrox Blog for you...
When I go to Internet Information Service Propertry of Blog >ASP.NET 2.0 Version>Edit Configuration>Authentication tab> error message saying Authenication An Error has occurred attempting to read the configuration. SQLProvider has already been added
source file C:\inetpub\wwwroot\blog\web.config.. I hope you can fix it up...Thank you for being helpful
Jeff:)

<?xml version="1.0"?>
<!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
  <appSettings>
    <add key="DefaultConnectionString" value="SqlServerConnectionString" />
    <add key="EmailFrom" value="You@YourProvider.Com"/>
    <add key="EmailTo" value="You@YourProvider.Com"/>
    <add key="FCKeditor:UserFilesPath" value="/Blog/UserFiles"/>
  </appSettings>

  <connectionStrings>
    <add name="SqlServerConnectionString" connectionString="server=(local)\SqlExpress;Attach DbFileName=|DataDirectory|Blog.mdf;Integrated Security=true;User Instance=true" providerName="System.Data.SqlClient" />
    <add name="AccessConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source=C:\Inetpub\wwwroot\InstantResults\Blog\App_ Data\Blog.mdb;User Id=admin;Password=;" providerName="System.Data.OleDb" />
  </connectionStrings>
  <system.web>

    <!--
            Set compilation debug="true" to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.

            Visual Basic options:
            Set strict="true" to disallow all data type conversions
            where data loss can occur.
            Set explicit="true" to force declaration of all variables.
        -->
    <compilation debug="true" strict="false" explicit="true" />

    <membership>
      <providers>
        <clear />
        <add name="AspNetSqlMembershipProvider"
            type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
            connectionStringName="SqlServerConnectionString"
            enablePasswordRetrieval="False"
            enablePasswordReset="True"
            requiresQuestionAndAnswer="True"
            applicationName="/"
            requiresUniqueEmail="true"
            passwordFormat="Hashed"
            maxInvalidPasswordAttempts="5"
            passwordAttemptWindow="10"
            passwordStrengthRegularExpression=""
            minRequiredPasswordLength="1"
            minRequiredNonalphanumericCharacters="0"
          />
      </providers>
    </membership>

    <roleManager enabled="true"
                 cacheRolesInCookie="true"
                 cookieName=".ASPROLES"
                 defaultProvider="SqlProvider">
      <providers>
        <add connectionStringName="SqlServerConnectionString" name="SqlProvider"
          type="System.Web.Security.SqlRoleProvider" />
      </providers>
    </roleManager>

    <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
    -->
    <authentication mode="Forms">
      <forms loginUrl="~/Login.aspx" />
    </authentication>

    <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.
    -->
    <customErrors mode="Off" defaultRedirect="ErrorPage.aspx">
      <error statusCode="404" redirect="ErrorPage.aspx"/>
      <error statusCode="500" redirect="ErrorPage.aspx"/>
    </customErrors>

    <pages>
      <namespaces>
        <clear />
        <add namespace="System" />
        <add namespace="System.Collections" />
        <add namespace="System.Collections.Specialized" />
        <add namespace="System.Configuration" />
        <add namespace="System.Text" />
        <add namespace="System.Text.RegularExpressions" />
        <add namespace="System.Web" />
        <add namespace="System.Web.Caching" />
        <add namespace="System.Web.SessionState" />
        <add namespace="System.Web.Security" />
        <add namespace="System.Web.Profile" />
        <add namespace="System.Web.UI" />
        <add namespace="System.Web.UI.WebControls" />
        <add namespace="System.Web.UI.WebControls.WebParts" />
        <add namespace="System.Web.UI.HtmlControls" />
      </namespaces>
    </pages>

  </system.web>
  <system.net>
    <mailSettings>
      <smtp deliveryMethod="Network">
        <network host="smtp@YourProvider.Com" port="25" />
      </smtp>
    </mailSettings>
  </system.net>

</configuration>


jeff
 
Old July 30th, 2006, 03:28 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Jeff,

You may want to try to clear the providers collection first?

<roleManager enabled="true"
    cacheRolesInCookie="true"
    cookieName=".ASPROLES"
    defaultProvider="SqlProvider">
    <providers>
<clear />
        <add connectionStringName="SqlServerConnectionString"
            name="SqlProvider"
            type="System.Web.Security.SqlRoleProvider" />
    </providers>
</roleManager>

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old August 10th, 2006, 10:56 AM
Authorized User
 
Join Date: Aug 2006
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to abel714 Send a message via Yahoo to abel714
Default

I have that confuration, but still get the same error as the original poster stated.

I know there are areas within SQL Server 2005 Express where one can configure remote connections.

However, can you post an explanation as to how one would go about changing this configuration where it is remote and local, or either, or both?

And, do you know why it would be configured for remote only if these apps are supposed to be local? Or is this erroneous?

Thanks

 
Old August 10th, 2006, 11:06 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Mike,

If you post follow up stuff, can you please indicate to what error you are referring. The OP posted two errors, so it would be helpful if you could signal what error you got, by posting the error message for example.

Anyway, the RemoteOnly stuff is not related to SQL Server:

<customErrors mode="Off" defaultRedirect="ErrorPage.aspx">
<error statusCode="404" redirect="ErrorPage.aspx"/>
<error statusCode="500" redirect="ErrorPage.aspx"/>
</customErrors>

The mode="Off" (or On or RemoteOnly) indicates when the custom error page should be shown.

Off means no-one gets a friendly error page; everyone, including remote users get the dirty details page.

On means no-one sees the actual error, but the friendly error page only.

RemoteOnly means remote users (e.g. visitors) get to see the friendly error page, while browsing from the local machine will give you detailed error information.

Does this help?

Imar

---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old August 10th, 2006, 12:18 PM
Authorized User
 
Join Date: Aug 2006
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to abel714 Send a message via Yahoo to abel714
Default

Imar,

I understand completely. This is so no potential malice can be committed by an unwanted visitor who has no good intentions on their agenda upon visiting the victim's site.

No problem, I will make an effort to be more elaborate in the future.

The only problem I have currently is with the photo album, which I just now realized I may have posted as a response to this post, which I did not intend to do, so if that is the case, my apologies. I will post this error as a new topic in an effort to get some feedback and ultimately, find a solution to the error.

Thank you again,
Mike

 
Old August 10th, 2006, 03:21 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
quote:This is so no potential malice can be committed by an unwanted visitor who has no good intentions on their agenda upon visiting the victim's site.
Yeah, that, and more. I don't think my mother would understand something like "object not set to an instance of an object. Error in line 179 of MySourceFile.vb". I am sure that, instead, she'd prefer something like:

Ooops, somehow an error occurred on the server while trying to process your request. We have logged the error, so we'll be able to fix it in no-time. In the mean-time, why don't you check out our search page to see if you can find something useful, or try our new product locator.

With these nice friendly error pages, you can present your end user with a message they understand, while at the same time you can still log the dirty details of the exception so you can do something about it....

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrox Blog in C# madAlan BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 22 June 12th, 2011 04:09 AM
error rendering control pnlAddEdit in Wrox Blog admwta ASP.NET 2.0 Basics 2 July 31st, 2008 10:48 AM
Wrox Blog tblessed23 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 16 May 14th, 2007 04:08 PM
Wrox Blog: Viewing individual blog entries Tawanda BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 7 May 7th, 2007 12:06 PM
Wrox blog suggestions nakori BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 June 15th, 2006 04:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.