View Single Post
  #14 (permalink)  
Old November 27th, 2007, 02:22 AM
amorphous amorphous is offline
Registered User
 
Join Date: Nov 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Imar wrote:
 Hi there,

Are there web.config file in any of the parent folders you are opening?

Or maybe you opened BegECom in Visual Studio and have Chapter02 as a sub folder in the Solution Explorer? If that's the case, try opening the Chapter02 folder as a site directly.
-------------------------------------

"web.config" question: I have a folder "C:\MyDir\ASP_NET\Chapter03\WroxUnited". There are web.config files in both the "Chapter03" and the "WroxUnited" folder (see below). The web site I open is "C:\MyDir\ASP_NET\Chapter03\WroxUnited". Should there only be a web.config file in the "Chapter03" folder and not in the contained "WroxUnited" folder?

The web site I opened was "C:\MyDir\ASP_NET\Chapter03". The problem does not seem to occur when I open the folder

Contents of "C:\MyDir\ASP_NET\Chapter03\web.config":
-------------------------
<?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 xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <appSettings/>
    <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.
        -->
        <compilation debug="true"/>
        <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        -->
        <authentication mode="Windows"/>
        <!--
            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="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm"/>
            <error statusCode="404" redirect="FileNotFound.htm"/>
        </customErrors>
        -->
    </system.web>
</configuration>
-------------------------

Contents of "C:\MyDir\ASP_NET\Chapter03\WroxUnited\web.config" :
-------------------------
<?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\Microsft.Net\Frameworks\v2.x\Config -->
<configuration>
  <!--
    Mode defines certain feature availability:
      Full: No restrictions
      Real: Runs as if a real site, without the view code, download and user/role view links
  -->
  <appSettings>
    <add key="mode" value="Full" />
  </appSettings>

    <!--
        define the connection string to the database
    -->
  <connectionStrings>
     <add name="WroxUnited"
         connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|WroxUnited.mdf;Integrated Security=True;User Instance=True"
         providerName="System.Data.SqlClient" />
  </connectionStrings>

  <system.web>

    <httpModules>
      <add name="Page" type="Wrox.Web.GlobalEvents.ThemeModule" />
    </httpModules>

    <!--
            Set compilation debug="true" to insert debugging symbols into the compiled page.
            Because this affects performance, set this value to true only during development.
        -->
    <compilation debug="true">
    </compilation>
    <!--
            Set forms authentication and define the login page
        -->
    <authentication mode="Forms">
      <forms loginUrl="Default.aspx"></forms>
    </authentication>
    <!--
            Enable the role manager
            This controls access to pages and the visibility of certain menu items
        -->
    <roleManager enabled="true"/>
    <anonymousIdentification enabled="true"/>
    <!--
            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="RemoteOnly">
      <error statusCode="404" redirect="missingPage.aspx"/>
        </customErrors>

    <!--
            Redefine the Site Map Provider, to add the security trimming attribute,
            which is off by default
        -->
    <siteMap defaultProvider="AspXmlSiteMapProvider" enabled="true">
      <providers>
        <clear/>
        <add name="AspXmlSiteMapProvider" type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
          siteMapFile="web.sitemap" securityTrimmingEnabled="true"/>
      </providers>
    </siteMap>

    <!--
            Define the user profile properties
        -->
    <profile enabled="true">
      <properties>
        <add name="MemberName"/>
        <add name="Name"/>
        <add name="Address"/>
        <add name="City"/>
        <add name="County"/>
        <add name="PostCode"/>
        <add name="Country"/>
        <add name="Mailings" type="System.Boolean"/>
        <add name="Email"/>
        <add name="Theme"/>
        <add name="Cart" serializeAs="Binary" type="Wrox.Commerce.ShoppingCart" allowAnonymous="true"/>
      </properties>
    </profile>

  </system.web>

  <system.net>
    <mailSettings>
      <!-- these settings define the mail server settings
        from: the user name from which the email is sent - this is the application that is sending the message
        host: the name of your mail server
        userName: the name the application will use to log into the mail server
        password: the password for the above user name
      -->
      <smtp from="[email protected]">
        <network host="your-mail-server-name"
                 userName="your-user-name"
                 password="your-password" />
      </smtp>
    </mailSettings>
  </system.net>

</configuration>
-------------------------

Reply With Quote