Fixing – A first chance exception of type ‘System.Configuration.ConfigurationErrorsException’ occurred in System.Configuration.dll

After some NuGet package update, my Web.config file was altered and contained two entries in [connectionStrings] with the same name:

<connectionStrings> <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="data source=s02.dev.nl\v2012;initial catalog=Test;Integrated Security=SSPI;Pooling=False;" /> <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet-Test.UI-20130328110613;Integrated Security=SSPI" />

</connectionStrings>

After removing one of the entries, the error was resolved.