Error in web.config

Nov 26, 2010 at 11:39 PM

I published a website with BE_2.0 RC, using asp.net 4.0 which my webhoster supports, it worked fine locally, I am receiving this error though my control panel:  This site is using xlm, and everything right out of the box.

System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Filename: \\?\C:\HostingSpaces\seniorge\seniorgeekpc.com\wwwroot\web.config 
Line number: 52 
Error: The configuration section 'system.web.extensions' cannot be read because it is missing a section declaration 

at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) 
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) 
at WebsitePanel.Providers.Web.WebServer.GetSite(String siteId) 
at WebsitePanel.EnterpriseServer.WebServerController.GetWebSite(Int32 siteItemId) 
at WebsitePanel.EnterpriseServer.esWebServers.GetWebSite(Int32 siteItemId) 
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) 
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) 
at WebsitePanel.EnterpriseServer.esWebServers.GetWebSite(Int32 siteItemId) 
at WebsitePanel.Portal.WebSitesEditSite.BindWebSite()

<system.web.extensions> <scripting> <webServices> <authenticationService enabled="true" requireSSL="false"/> </webServices> </scripting> </system.web.extensions>

 

 

 

This error when trying to bring the site up in my browser.

 

500 - Internal server error.

There is a problem with the resource you are looking for, and it cannot be displayed.

Thank you.

Coordinator
Nov 27, 2010 at 12:09 AM

It looks like this is a documented problem where depending on if certain hotfixes haven't been installed to the server, certain section groups like "system.web.extensions" in .NET 4.0 will not automatically be registered at the machine level.  This is sort of frustrating since it should be the same across all .NET 4.0 systems, regardless of which hotfixes or updates have been applied.  There's two solutions.

Solution # 1 - Add the following in the beginning of the <configSections> towards the top of the web.config file:

<?xml version="1.0"?>
<configuration>
	<configSections>

		....... new code starts here .......

		<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
		  <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
			<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
			<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
			  <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
			  <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
			  <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
			  <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
			</sectionGroup>
		  </sectionGroup>
		</sectionGroup>
	
		....... new code ends here .......

Solution # 2 - Instead of the above, because the <system.web.extensions> section the error is complaining about isn't that necessary for BE, you could delete the <system.web.extensions> section.  It was added recently to support the case where you want to communicate with your blog via Windows Phone 7 (or possibly with other external systems too).  This solution # 2 is to delete the following from the web.config file:

<system.web.extensions>
	<scripting>
		<webServices>
			<authenticationService enabled="true" requireSSL="false"/>
		</webServices>
	</scripting>
</system.web.extensions>
Nov 27, 2010 at 5:03 PM
Edited Nov 27, 2010 at 6:35 PM

Thanks Ben

Solution 2 took care of the control panel access but am now receiving this message in my browser when trying to connect.

 

 
Line 15:     }
Line 16: 
Line 17:     public override ExtensionSettings AddServiceConfiguration(ExtensionSettings settings)
Line 18:     {
Line 19:         settings.Help = "<span  style=\"font-weight: bold;\">StumbleUpon</span> (http://www.stumbleupon.com) is a rapidly growing social bookmarking and counter service. " +

 

Nov 27, 2010 at 5:42 PM
Edited Nov 27, 2010 at 6:40 PM

I started over with a clean web.config and tried Solution 1 and am getting this error message in my browser.

 
Line 15:     }
Line 16: 
Line 17:     public override ExtensionSettings AddServiceConfiguration(ExtensionSettings settings)
Line 18:     {
Line 19:         settings.Help = "<span  style=\"font-weight: bold;\">StumbleUpon</span> (http://www.stumbleupon.com) is a rapidly growing social bookmarking and counter service. " +

 

c:\HostingSpaces\seniorge\seniorgeekpc.com\wwwroot\App_Code\Extensions\BookmarkButtons\BuzzButton.cs

Nov 27, 2010 at 6:42 PM

I got this one solved Ben, I just deleted the BookmarksButtons folder mentioned above. running seniorgeekpc.com with BE_2.0 RC with XML, thanks for your help.