This project is read-only.
1
Vote

Part 4 connectionString

description

In part 4 we are told to make changes to the Web.config we are told to add <connectionStrings> <add name="MusicStoreEntities" connectionString="Data Source=|DataDirectory|MvcMusicStore.sdf" providerName="System.Data.SqlServerCe.4.0"/> </connectionStrings> before the last </configuration> tag. when I run the code I get this error message HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid. Detailed Error Information: Module IIS Web Core Notification Unknown Handler Not yet determined Error Code 0x800700b7 Config Error Config section 'connectionStrings' already defined. Sections must only appear once per config file. See the help topic <location> for exceptions Config File \\?\c:\users\kertins\documents\visual studio 2013\Projects\MvcMusicStore\MvcMusicStore\web.config Requested URL http://localhost:51708/ Physical Path Logon Method Not yet determined Logon User Not yet determined Request Tracing Directory C:\Users\Kertins\Documents\IISExpress\TraceLogFiles\ Config Source: 107: 108: <connectionStrings> 109: <add name="MusicStoreEntities" More Information: This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error. If you see the text "There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined", this error is because you are running a .NET Framework 3.5-based application in .NET Framework 4. If you are running WebMatrix, to resolve this problem, go to the Settings node to set the .NET Framework version to ".NET 2". You can also remove the extra sections from the web.config file. View more information » It looks like the issue is Config Source: 107: 108: <connectionStrings> 109: <add name="MusicStoreEntities" but I dont know how to get it to work... could someone help explain this and offer a solution.

comments

Markmugen wrote May 22, 2014 at 1:56 PM

sorry all the formatting was removed from the post....

timtrag12 wrote Sep 11, 2014 at 2:53 AM

Remove the connectionStrings tags you added and just place <add name="MusicStoreEntities"
connectionString="Data Source=|DataDirectory|MvcMusicStore.sdf"
providerName="System.Data.SqlServerCe.4.0"/> inside the existing tags

slimz wrote Feb 23, 2015 at 7:35 PM

I have change the code like you said but i am still getting the same error message. please someone help.


HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.



Detailed Error Information:



Module
IIS Web Core

Notification
Unknown

Handler
Not yet determined

Error Code
0x80070032

Config Error
The configuration section 'add' cannot be read because it is missing a section declaration

Config File
\?\C:\Users\Kaoma\Desktop\MvcMusicStore 2\MvcMusicStore\MvcMusicStore\web.config



Requested URL
http://localhost:53652/ Physical Path Logon Method Not yet determined Logon User Not yet determined Request Tracing Directory C:\Users\Kaoma\Documents\IISExpress\TraceLogFiles\ Config Source: 107: 108: <add name="MusicStoreEntities" 109: connectionString="Data Source=|DataDirectory|MvcMusicStore.sdf"