views:

440

answers:

1

I'm trying to add a section to an ASP.NET web.config file for using the default profile provider. Here's what I'm adding to web.config in the system.web node:

<profile defaultProvider="AspNetSqlProfileProvider">
  <providers>
   <clear/>
   <add name="AspNetSqlProfileProvider"
     type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
     connectionStringName="ApplicationServices"
     applicationName="/"
            />
  </providers>
  <properties>
   <group name="UserDetails">
    <add name="FirstName" />
    <add name="LastName" />
    <add name="BirthDate"
      type="System.DateTime" />
   </group>
  </properties>
 </profile>

I can build the website successfully, but as soon as it completes I get the prompt that web.config has been modified outside of the editor and do I want to reload it. I click Yes, and the profile section disappears. Everything else in the web.config file remains intact and functioning correctly.

Any ideas of where to look for troubleshooting this issue? Thanks!

A: 

It sounds like you are editing the output config file in the Web site's root and that the build is overwriting with the unedited config held in the ASP.NET project.

Mitch Wheat