I had done one publish to my MVC application. After that, I cannot debug it anymore!
This is the error. It seems that my visual studio web server is loading machine.config
Server Error in ‘/’ Application.
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 connection name ‘LocalSqlServer’ was not found in the applications configuration or the connection string is empty.
Source Error:
Line 255:
Line 256:
Source File: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config Line: 257
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237
This is how my web.config looks like, and there is nothing in my code that uses ASP.Net Membership as my authentication mode is “Windows”.
I did manage to run it again in Visual Studio once, after I set the build mode from “Release” to “Debug” vice versa, but after I published again today.. The problem came back.
<configuration>
<connectionStrings>
<clear/>
<add name="ApplicationServices" connectionString="Data Source=SCG1SQL-64;Initial Catalog=Metallurgy;Integrated Security=True"
providerName="System.Data.SqlClient" />
<add name="mandb100ConnectionString" connectionString="Data Source=scg1sql-64;Initial Catalog=mandb100;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="1.0.0.0" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<authentication mode="Windows"/>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</configuration>
This link might be of help: http://msdn.microsoft.com/en-us/library/webmatrix.webdata.preapplicationstartcode(v=vs.99).aspx
That’s how I solved my problem. Apparently, this WebMatrix SimpleMembership is enabled by default. So I added this line in my web.config, and the problem disappeared!!!