web-configconnection-string

Invalid Web.config Configuration Data


I changed my connectionStrings section in web.config to Integrated Security="True" to hide username and password, but met the error:

HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid.

Before change:

  <connectionStrings>
    <add connectionString="Server=v-s1;Database=DB1;User ID=Admin;Password=AdminPW;Persist Security Info=True;Max Pool Size=200;Connection Timeout=60" name="MROConstr" />
  </connectionStrings>

After change:

  <connectionStrings>
    <add connectionString="Server=v-s1;Database=DB1;Integrated Security="True";Max Pool Size=200;Connection Timeout=60" name="V1Constr" />
  </connectionStrings>

Solution

  • Look here:

    How do I resolve "HTTP Error 500.19 - Internal Server Error" on IIS7.0

    Looks like the user account you're using for your app pool doesn't have rights to the web site directory, so it can't read config from there. Check the app pool and see what user it is configured to run as. Check the directory and see if that user has appropriate rights to it. While you're at it, check the event log and see if IIS logged any more detailed diagnostic information there.

    Specifically, it sounds like the user you're running as doesn't have permissions for one or more of the things it needs to do.

    ALSO:

    Be sure to consider the possibility that maybe you accidentally introduced a typo in a completely unrelated section of web.config. Ideally, you can "diff" your current version with a backup web.config, to confirm the ONLY changes are those you DELIBERATELY made.