IIS authentication issue - asp.net

In my Web.config I got forms type authentication. From VS 2013 I got no problem login to my website. this site is created as standalone application pool using Integrated pipeline mode. when I published this site I cannot login anymore. I got error " Unknown exception occurs while logon to system. In IIS under authentication I have Anonymous Athentication disabled, Forms Athentication enabled, windows athentication enabled and ASP.NET disabled. if I disabled windows athentication I will get not authorize. and even if enable Anonymous athentication I still can't login. check my web.config code below. any idea ? thanks
<?xml version="1.0" encoding="UTF-8"?><configuration>
<configSections>
<sectionGroup name="system.web.extensions"
type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting"type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
</sectionGroup>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.WebContextHandler, Spring.Web"/>
<section name="typeAliases" type="Spring.Context.Support.TypeAliasesSectionHandler, Spring.Core"/>
</sectionGroup>
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging"/>
</sectionGroup>
<section name="dataContext" type="DotWebDev.Common.Data.DataContextConfiguration, DotWebDev.Common"/>
<section name="framePage" type="DotWebDev.UI.DynamicPages.Configurations.FramePageConfigurationSection, DotWebDev.UI"/></configSections>
<appSettings>
<add key="autoFormsAuthentication" value="false" />
<add key="enableSimpleMembership" value="false"/>
<add key="PreserveLoginUrl" value="true" />
</appSettings>
<dataContext enabledMSDTC="false" commandTimeout="30">
<settings>
<setting name="MembershipDataContext"connectionType="System.Data.SqlClient.SqlConnection" connectionStringName="Global"/>
<setting name="ExtensionModelDataContext" connectionType="System.Data.SqlClient.SqlConnection" connectionStringName="Global"/>
<setting name="ProductManagementDataContext" connectionType="System.Data.SqlClient.SqlConnection" connectionStringName="Global"/>
</settings>
</dataContext>
<connectionStrings>
<add name="Global" providerName="System.Data.SqlClient" connectionString="Data Source=.\sqlexpress;Initial Catalog=UadminMgr;Integrated Security=SSPI;persist security info=False; Trusted_Connection=Yes; Max Pool Size=4096; Min Pool Size=10"/>
</connectionStrings>
<system.web>
<compilation debug="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies>
</compilation>
<authentication mode="Forms">
<forms name=".Global" defaultUrl="FramePage.svc" loginUrl="LogOn.aspx" slidingExpiration="true" timeout="60"/>
</authentication>
<httpRuntime maxRequestLength="4096"/>
<pages configSource="Config\pages.config"/>
<globalization culture="auto" uiCulture="auto"/>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add path="*.aspx" verb="*" type="Spring.Web.Support.PageHandlerFactory, Spring.Web"/>
<add path="DynamicPage.svc" verb="*" type="DotWebDev.UI.Services.DynamicPageHandler, DotWebDev.UI"/>
<add path="DynamicPageDataService.svc" verb="GET, POST" type="DotWebDev.UI.Services.DynamicPageDataServiceHandler, DotWebDev.UI"/>
<add path="DynamicPageDownloadExcel.svc" verb="*" type="DotWebDev.UI.Services.DynamicPageDataToExcelHandler, DotWebDev.UI"/>
<add path="DynamicPageHtmlPrinter.svc" verb="*" type="DotWebDev.UI.Services.DynamicPageDataToHtmlHandler, DotWebDev.UI"/>
<add path="DetailPanel.svc" verb="*" type="DotWebDev.UI.Services.DetailPanelPageHandler, DotWebDev.UI"/>
<add path="AggregatePanel.svc" verb="*" type="DotWebDev.UI.Services.AggregatePanelPageHandler, DotWebDev.UI"/>
<add path="FramePage.svc" verb="*" type="DotWebDev.UI.Services.FramePageHandler, DotWebDev.UI"/>
<add path="ContextMonitor.ashx" verb="*" type="Spring.Web.Support.ContextMonitor, Spring.Web"/>
<add path="*_AppService.axd" verb="*" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="Spring" type="Spring.Context.Support.WebSupportModule, Spring.Web"/>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="PlatformModule" type="DotWebDev.Platform.PlatformModule, DotWebDev.Platform"/>
</httpModules>
<machineKey configSource="Config\machineKey.config"/>
<membership configSource="Config\membership.config"/>
<roleManager configSource="Config\roleManager.config"/>
<sessionState mode="InProc" stateNetworkTimeout="30" timeout="14400"/>
<customErrors configSource="Config\customErrors.config"/>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="OptionInfer" value="true"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<remove name="ScriptModule"/>
<add name="Spring" type="Spring.Context.Support.WebSupportModule, Spring.Web"/>
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="PlatformModule" type="DotWebDev.Platform.PlatformModule, DotWebDev.Platform"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<add name="DynamicPage" path="DynamicPage.svc" preCondition="managedHandler" verb="*" type="DotWebDev.UI.Services.DynamicPageHandler, DotWebDev.UI"/>
<add name="DynamicPageDataService" path="DynamicPageDataService.svc" preCondition="managedHandler" verb="GET, POST" type="DotWebDev.UI.Services.DynamicPageDataServiceHandler, DotWebDev.UI"/>
<add name="DynamicPageDownloadExcel" path="DynamicPageDownloadExcel.svc" preCondition="managedHandler" verb="GET, POST" type="DotWebDev.UI.Services.DynamicPageDataToExcelHandler, DotWebDev.UI"/>
<add name="DynamicPageHtmlPrinter" path="DynamicPageHtmlPrinter.svc" preCondition="managedHandler" verb="*" type="DotWebDev.UI.Services.DynamicPageDataToHtmlHandler, DotWebDev.UI"/>
<add name="DetailPanel" path="DetailPanel.svc" preCondition="managedHandler" verb="*" type="DotWebDev.UI.Services.DetailPanelPageHandler, DotWebDev.UI"/>
<add name="AggregatePanel" path="AggregatePanel.svc" preCondition="managedHandler" verb="*" type="DotWebDev.UI.Services.AggregatePanelPageHandler, DotWebDev.UI"/>
<add name="FramePage" path="FramePage.svc" preCondition="managedHandler" verb="*" type="DotWebDev.UI.Services.FramePageHandler, DotWebDev.UI"/>
</handlers>
<defaultDocument>
<files>
<clear/>
<add value="LogOn.aspx"/>
</files>
</defaultDocument>
</system.webServer>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<behaviors>
<serviceBehaviors>
<behavior name="AuthenticationBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="RestfulEndpointBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483646"/>
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="HttpStreaming">
<security mode="None">
<transport clientCredentialType="None"/>
</security>
</binding>
</webHttpBinding>
<mexHttpBinding>
<binding name="HttpStreaming" closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="01:00:00" sendTimeout="01:00:00"/>
</mexHttpBinding>
</bindings>
<services>
<service name="DotWebDev.Platform.Services.OrganizationService" behaviorConfiguration="AuthenticationBehavior">
<clear/>
<endpoint address="http://localhost:51702/Services/OrganizationService.svc" behaviorConfiguration="RestfulEndpointBehavior" binding="webHttpBinding" bindingConfiguration="HttpStreaming" contract="DotWebDev.Platform.Services.IOrganizationService" listenUriMode="Explicit"/>
<endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="HttpStreaming" contract="IMetadataExchange"/>
</service>
<service name="DotWebDev.Platform.Services.RoleService" behaviorConfiguration="AuthenticationBehavior">
<clear/>
<endpoint address="http://localhost:51702/Services/RoleService.svc" behaviorConfiguration="RestfulEndpointBehavior" binding="webHttpBinding" bindingConfiguration="HttpStreaming" contract="DotWebDev.Platform.Services.IRoleService" listenUriMode="Explicit"/>
<endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="HttpStreaming" contract="IMetadataExchange"/>
</service>
<service name="DotWebDev.Platform.Services.HierarchyService" behaviorConfiguration="AuthenticationBehavior">
<clear/>
<endpoint address="http://localhost:51702/Services/HierarchyService.svc" behaviorConfiguration="RestfulEndpointBehavior" binding="webHttpBinding" bindingConfiguration="HttpStreaming" contract="DotWebDev.Platform.Services.IHierarchyService" listenUriMode="Explicit"/>
<endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="HttpStreaming" contract="IMetadataExchange"/>
</service>
<service name="DotWebDev.Platform.Services.ConcreteDataService" behaviorConfiguration="AuthenticationBehavior">
<clear/>
<endpoint address="http://localhost:51702/Services/ConcreteDataService.svc" behaviorConfiguration="RestfulEndpointBehavior" binding="webHttpBinding" bindingConfiguration="HttpStreaming" contract="DotWebDev.Platform.Services.IConcreteDataService" listenUriMode="Explicit"/>
<endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="HttpStreaming" contract="IMetadataExchange"/>
</service>
</services>
</system.serviceModel>
<spring>
<typeAliases>
<alias name="WebResource" type="DotWebDev.UI.WebResources.WebResource, DotWebDev.UI"/>
<alias name="WebResourceGroup" type="DotWebDev.UI.WebResources.WebResourceGroup, DotWebDev.UI"/>
</typeAliases>
<context>
<resource uri="~/Spring/all.config"/>
</context>
</spring>
<common>
<logging>
<factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4Net">
<!-- Possible values are ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF -->
<arg key="Level" value="ERROR"/>
<arg key="configType" value="FILE"/>
<arg key="configFile" value="~/Config/log4net.config"/>
</factoryAdapter>
</logging>
</common>
<framePage NavigationBarTitle="$Resources.Common.NavigationBarTitle, DotWebDev.Web$" FramePageTitle="$Resources.Common.FramePageTitle, DotWebDev.Web$" HeaderTemplate="~/Templates/Header.ascx" DefaultPageUrl="Default.aspx" DefaultTabTitle="$Resources.Common.DefaultTabTitle, DotWebDev.Web$" EnableMultipleTabs="true" MaximumTabs="10"/>
Stack trace:
à DotWebDev.Platform.HttpAuthenticationContext.Login(String username, String password)
à DotWebDev.Web.LogOn.ButtonLogin_Click(Object sender, EventArgs e)
2015-07-27 13:13:11,536 ERROR DotWebDev.Platform.Linq.MembershipDbProvider [(null)] - System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
à DotWebDev.Platform.Linq.MembershipDbProvider.EncodePassword(String password, String passwordSalt, Int32 passwordFormat)
à DotWebDev.Platform.Linq.MembershipDbProvider.Login(String username, String password)
2015-07-27 13:13:11,565 ERROR ASP.logon_aspx [(null)] - System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
à DotWebDev.Platform.Linq.MembershipDbProvider.EncodePassword(String password, String passwordSalt, Int32 passwordFormat)
à DotWebDev.Platform.Linq.MembershipDbProvider.Login(String username, String password)
à DotWebDev.Platform.HttpAuthenticationContext.Login(String username, String password)
à DotWebDev.Web.LogOn.ButtonLogin_Click(Object sender, EventArgs e)
2015-07-27 13:14:07,611 ERROR DotWebDev.Platform.Linq.MembershipDbProvider [(null)] - System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
à DotWebDev.Platform.Linq.MembershipDbProvider.EncodePassword(String password, String passwordSalt, Int32 passwordFormat)
à DotWebDev.Platform.Linq.MembershipDbProvider.Login(String username, String password)
2015-07-27 13:14:07,611 ERROR ASP.logon_aspx [(null)] - System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
à DotWebDev.Platform.Linq.MembershipDbProvider.EncodePassword(String password, String passwordSalt, Int32 passwordFormat)
à DotWebDev.Platform.Linq.MembershipDbProvider.Login(String username, String password)
à DotWebDev.Platform.HttpAuthenticationContext.Login(String username, String password)
à DotWebDev.Web.LogOn.ButtonLogin_Click(Object sender, EventArgs e)
2015-07-27 13:14:26,127 ERROR DotWebDev.Platform.Linq.MembershipDbProvider [(null)] - System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
à DotWebDev.Platform.Linq.MembershipDbProvider.EncodePassword(String password, String passwordSalt, Int32 passwordFormat)
à DotWebDev.Platform.Linq.MembershipDbProvider.Login(String username, String password)
2015-07-27 13:14:26,127 ERROR ASP.logon_aspx [(null)] - System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
à DotWebDev.Platform.Linq.MembershipDbProvider.EncodePassword(String password, String passwordSalt, Int32 passwordFormat)
à DotWebDev.Platform.Linq.MembershipDbProvider.Login(String username, String password)
à DotWebDev.Platform.HttpAuthenticationContext.Login(String username, String password)
à DotWebDev.Web.LogOn.ButtonLogin_Click(Object sender, EventArgs e)

Related

ASP.NET AJAX not working on localhost for .NET 3.5

The live application has been deployed for a while and works fine. The application pool is v2.0 Classic. It is hosted on Windows Server 2008 R2.
My local environment is Windows 8.1. I'm debugging in IIS Express. I get the following errors in the browser developer tools:
Uncaught Error: ASP.NET Ajax client-side framework failed to load.
Uncaught ReferenceError: Sys is not defined
All of the ScriptResource.axd GET requests result in a 404 error. Any ideas on fixing the .NET Ajax?
Btw, I've already done all the suggestions that I've previously seen on how to resolve this, particularly with the handlers. I have the following web.config.
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings>
<!-- snipped -->
</appSettings>
<connectionStrings>
<!-- snipped -->
</connectionStrings>
<system.web>
<compilation debug="true" strict="false" explicit="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<pages>
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Collections"/>
<add namespace="System.Collections.Specialized"/>
<add namespace="System.Configuration"/>
<add namespace="System.Text"/>
<add namespace="System.Text.RegularExpressions"/>
<add namespace="System.Web"/>
<add namespace="System.Web.Caching"/>
<add namespace="System.Web.SessionState"/>
<add namespace="System.Web.Security"/>
<add namespace="System.Web.Profile"/>
<add namespace="System.Web.UI"/>
<add namespace="System.Web.UI.WebControls"/>
<add namespace="System.Web.UI.WebControls.WebParts"/>
<add namespace="System.Web.UI.HtmlControls"/>
</namespaces>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"/>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>
</pages>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
<authentication mode="Forms">
<forms loginUrl="login.aspx" timeout="120" slidingExpiration="true"/>
</authentication>
<authorization>
<allow roles="(snipped)"/>
<deny roles="(snipped)"/>
<deny users="?,*"/>
</authorization>
<roleManager enabled="true" defaultProvider="SimpleRoleProvider">
<providers>
<clear/>
<add name="SimpleRoleProvider" type="MyProject.SimpleRoleProvider" applicationName="MyProject"/>
</providers>
</roleManager>
<customErrors mode="RemoteOnly" defaultRedirect="error">
<!--<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />-->
<error statusCode="500" redirect="error/500.html"/>
</customErrors>
<sessionState mode="InProc" cookieless="false" timeout="240"/>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated" />
<add name="Telerik.Web.UI.WebResource.axd_*" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</handlers>
<rewrite>
<rules>
<rule name="API Rule" stopProcessing="true">
<match url="api/(.*)" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
<add input="{REQUEST_URI}" pattern="/api/PublicService\.svc.*" negate="true" />
</conditions>
<action type="Rewrite" url="api/PublicService.svc/{R:1}" appendQueryString="true" />
</rule>
<rule name="Main Rule" stopProcessing="true">
<match url=".*"/>
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
</conditions>
<action type="Rewrite" url="index.php/{R:0}"/>
</rule>
</rules>
</rewrite>
<modules>
<remove name="ScriptModule"/>
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
</system.webServer>
<location path="ScriptResource.axd">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
<!-- other locations snipped -->
<system.serviceModel>
<extensions>
<behaviorExtensions>
<add name="MyWebHttpBehaviorExtension" type="MyProject.CustomBehaviorExtensionElement, MyProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
<add name="MyFaultHiderBehaviorExtension" type="MyProject.FaultHiderBehaviorExtensionElement, MyProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</behaviorExtensions>
</extensions>
<behaviors>
<endpointBehaviors>
<behavior name="MyProject.AspNetAjaxBehavior">
<enableWebScript/>
<MyWebHttpBehaviorExtension/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="MyProject.AspNetAjaxBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
<services>
<service name="MyProject.Api.PublicService">
<endpoint address="" behaviorConfiguration="MyProject.AspNetAjaxBehavior" bindingConfiguration="WebServicesBinding" binding="webHttpBinding" contract="MyProject.Api.PublicService"/>
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="WebServicesBinding">
<security mode="None"/>
</binding>
<binding name="WebServicesBindingHttps">
<security mode="Transport"/>
</binding>
</webHttpBinding>
<basicHttpBinding>
<binding name="GatewaySoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
<system.codedom>
<compilers>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="OptionInfer" value="true"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
<runtime>
<assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
I have double-checked the AXD handler in the applicationhost.config for IIS Express. It appears that I have .NET 2.0 AXD handlers. (But I have little expertise in interpreting these.)
<handlers accessPolicy="Read, Script">
<!-- non-AXD handlers snipped -->
<add name="AXD-ISAPI-4.0_64bit" path="*.axd" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
<add name="AXD-ISAPI-4.0_32bit" path="*.axd" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
<add name="TraceHandler-Integrated-4.0" path="trace.axd" verb="GET,HEAD,POST,DEBUG" type="System.Web.Handlers.TraceHandler" preCondition="integratedMode,runtimeVersionv4.0" />
<add name="WebAdminHandler-Integrated-4.0" path="WebAdmin.axd" verb="GET,DEBUG" type="System.Web.Handlers.WebAdminHandler" preCondition="integratedMode,runtimeVersionv4.0" />
<add name="AssemblyResourceLoader-Integrated-4.0" path="WebResource.axd" verb="GET,DEBUG" type="System.Web.Handlers.AssemblyResourceLoader" preCondition="integratedMode,runtimeVersionv4.0" />
<add name="ScriptHandlerFactoryAppServices-Integrated-4.0" path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" preCondition="integratedMode,runtimeVersionv4.0" />
<add name="ScriptResourceIntegrated-4.0" path="*ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" preCondition="integratedMode,runtimeVersionv4.0" />
<add name="TraceHandler-Integrated" path="trace.axd" verb="GET,HEAD,POST,DEBUG" type="System.Web.Handlers.TraceHandler" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="WebAdminHandler-Integrated" path="WebAdmin.axd" verb="GET,DEBUG" type="System.Web.Handlers.WebAdminHandler" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="AssemblyResourceLoader-Integrated" path="WebResource.axd" verb="GET,DEBUG" type="System.Web.Handlers.AssemblyResourceLoader" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="AXD-ISAPI-2.0" path="*.axd" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0" />
<add name="AXD-ISAPI-2.0-64" path="*.axd" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0" />
</handlers>
As the site is configured to run in .NET 2.0 (or possibly 3.5) you need to install the AJAX control toolkit DLLs in your bin, as they are likely installed to the GAC on the production server, which is why it works there. In order for it to be able to load the 2.0 DLLs you'll need to either install the DLLs to the GAC on your machine or include them in the bin directory. This answer should help with that.
Fixed. The problem was not with my web.config. In fact, I could not find any problem with any of my files or code. Ultimately, I had to recreate the project and copy my files in. Specifically, in order:
Create new empty ASP.NET project. (Visual Studio did this in 4.5 by default.)
Change the target framework to version 3.5.
Copy the code files from the current project.
In the project properties of the new project, make sure that the assembly name and root namespace of the new project match that of the existing project.
Add the necessary references in the new project.
Run the new project in debug mode, to test it, confirming that all works as it should.
Copy everything back, overwriting the old project, with the following caveats:
There is no need to overwrite the old solution (in my situation, anyway).
Be sure to overwrite the old VS proj file, and the bin folder.
I am using Git for source control, so it will automatically pick up any files that are new/different, and ignore others.
In my case, there are two possibilities (that I can think of) for the source of the problem. I don't know which is the real cause:
I was missing /My Project/MyExtensions/MyWebExtension.vb.
Something in the vsproj file itself.

Modifying a web.config in ASP.NET 4.0

I have a VB project that I have been assigned. My VB is not great, and my preference is C#, so I converted the code.
Converting the code was straight forward, but getting a Web.config file that works is causing me lots of headaches.
The VB project was started with ASP.NET 2.0 and upgraded with 3.5 features.
Here are the full Web Config files, in all their gory details, starting with the VB web.config file:
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings/>
<connectionStrings>
<add name="MaintenanceConnectionString" connectionString="Data Source=data1;Initial Catalog=Catalog1;User Id=abc123;Password=abc123;" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.net>
<mailSettings>
<smtp>
<network host="172.16.8.200" port="25"/>
</smtp>
</mailSettings>
</system.net>
<system.web>
<compilation debug="true" strict="false" explicit="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</assemblies>
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</buildProviders>
</compilation>
<pages>
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Collections"/>
<add namespace="System.Collections.Generic"/>
<add namespace="System.Collections.Specialized"/>
<add namespace="System.Configuration"/>
<add namespace="System.Text"/>
<add namespace="System.Text.RegularExpressions"/>
<add namespace="System.Web"/>
<add namespace="System.Web.Caching"/>
<add namespace="System.Web.SessionState"/>
<add namespace="System.Web.Security"/>
<add namespace="System.Web.Profile"/>
<add namespace="System.Web.UI"/>
<add namespace="System.Web.UI.WebControls"/>
<add namespace="System.Web.UI.WebControls.WebParts"/>
<add namespace="System.Web.UI.HtmlControls"/>
</namespaces>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>
</pages>
<authentication mode="Windows" />
<customErrors mode="Off"/>
<httpHandlers>
<remove path="*.asmx" verb="*"/>
<add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
<add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
<add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="OptionInfer" value="true"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<remove name="ScriptModule"/>
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
In my efforts to try and get the integrated Windows security to work, I have tried to duplicate most of its structure in this C# Web.config file:
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings>
<add key="WAREHOUSE" value="http:\\web2\Warehouse.aspx" />
<add key="WAREHOUSE_STATUS" value="http:\\web2\WarehouseStatus.aspx" />
</appSettings>
<connectionStrings>
<add name="WEB2" connectionString="Data Source=data2;Initial Catalog=Catalog2;User Id=abc123;Password=abc123;" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.net>
<mailSettings>
<smtp>
<network host="172.16.8.200" port="25"/>
</smtp>
</mailSettings>
</system.net>
<system.web>
<authentication mode="Windows" />
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="*"/>
</assemblies>
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</buildProviders>
</compilation>
<customErrors mode="Off" />
<pages>
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Collections"/>
<add namespace="System.Collections.Generic"/>
<add namespace="System.Collections.Specialized"/>
<add namespace="System.Configuration"/>
<add namespace="System.Text"/>
<add namespace="System.Text.RegularExpressions"/>
<add namespace="System.Web"/>
<add namespace="System.Web.Caching"/>
<add namespace="System.Web.Security"/>
<add namespace="System.Web.SessionState"/>
<add namespace="System.Web.Profile"/>
<add namespace="System.Web.UI"/>
<add namespace="System.Web.UI.HtmlControls"/>
<add namespace="System.Web.UI.WebControls"/>
<add namespace="System.Web.UI.WebControls.WebParts"/>
</namespaces>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>
</pages>
<trace enabled="true" />
<httpHandlers>
<remove path="*.asmx" verb="*"/>
<add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
<add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
<add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
</system.web>
<bindings />
<client />
<behaviors>
<serviceBehaviors>
<behavior name="debug">
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<behavior name="serviceTypeBehaviors">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceCredentials>
<clientCertificate>
<authentication certificateValidationMode="None" mapClientCertificateToWindowsAccount="true" />
</clientCertificate>
</serviceCredentials>
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true">
<serviceActivations>
<add factory="System.ServiceModel.Activation.ServiceHostFactory" relativeAddress="~/mainframe/MainFrame.svc" service="AcpServiceNS.MainFrameService" />
</serviceActivations>
</serviceHostingEnvironment>
<services>
<service behaviorConfiguration="serviceTypeBehaviors" name="AcpServiceNS.AcpCoilService">
<endpoint address="" binding="basicHttpBinding" contract="AcpServiceNS.IAcpCoilService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
<service behaviorConfiguration="serviceTypeBehaviors" name="AcpServiceNS.AcpEmployee">
<endpoint address="" binding="basicHttpBinding" contract="AcpServiceNS.IAcpEmployee" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
<service behaviorConfiguration="serviceTypeBehaviors" name="AcpServiceNS.AcpPackout">
<endpoint address="" binding="basicHttpBinding" contract="AcpServiceNS.IAcpPackout" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
<service behaviorConfiguration="serviceTypeBehaviors" name="AcpServiceNS.ErpService">
<endpoint address="" binding="basicHttpBinding" contract="AcpServiceNS.IErpData" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
<service behaviorConfiguration="serviceTypeBehaviors" name="AcpServiceNS.MainFrameService">
<endpoint address="" binding="basicHttpBinding" contract="AcpServiceNS.IMainFrameService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<remove name="ScriptModule"/>
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</handlers>
</system.webServer>
</configuration>
Everytime I try to run my project, I get another error from localhost IIS 8.0, like the 500.19 error below:
The requested page cannot be accessed because the related configuration data for the page is invalid.
Detailed Error Information:
Config Error There is a duplicate 'system.web.extensions/scripting/webServices/jsonSerialization' section defined
In the Config Source: section, it is pointing to Line 7:
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
I suppose I should change all of these to use Version 4.0.0.0, but I'm not sure where to get the Public Key Token from, if there is a 4.0 version on my machine, or if I have this defined elsewhere already (I was not able to find another jsonSerialization section with a document search).
How do I fix this?
Is there a way for Visual Studio 2010 to rebuild a proper Web.config file?
system.web.extensions section starting from .net 4.0 is configured by default so you don't need to register section, just use section to configure if defaults not good for you.
Just remove it, as it already registered by machine.config
<sectionGroup name="system.web.extensions" ...>
...
</sectionGroup>
...
Check your machine.config, may be it's already defined there, or you may be inheriting another web.config that is up in your directory strcture.

I can't get any data from my database using NHibernate sessionfactory object in ASP.Net 3.5

I have checked that I can connect and get data from the DB using regular C#, which I can. However, when I try to extract data from my DB via session/ sessionfactory, I get nothing. I am a newbie and I suspect this is an easy fix for a seasoned professional, but I have been researching and am at a loss. Here is my code: (in hibernate.cfg.xml, the server name, username, and password are changed for privacy reasons):
hibernate.cfg.xml
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" >
<session-factory >
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.driver_class">NHibernate.Driver.OracleClientDriver</property>
<property name="connection.connection_string">Data Source=NAME;User Id=USERID;Password=USERID;Integrated Security=no;</property>
<property name="show_sql">true</property>
<property name="dialect">NHibernate.Dialect.Oracle10gDialect</property>
</session-factory>
</hibernate-configuration>
EnumsTable.hbc.xml
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="DataTransfers" namespace="DataTransfers">
<class name="DataTransfers.EnumsTable, DataTransfers" table="TIME_LOG_ENUMS" >
<id column="ENUM_ID_PK" name="ENUM_ID_PK" type="Byte[]" unsaved-value="0">
<generator class="native"></generator>
</id>
<property name="ENUM_NAME" column="ENUM_NAME" type="string" length="100" not-null="false"/>
</class>
</hibernate-mapping>
EnumsTable.cs
namespace DataTransfers
{
public class EnumsTable
{
private Byte[] enum_id_pk {get; set;}
private string enum_name { get; set;}
}
}
Web.config
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings>
<add key="DATA_SOURCE" value="serverName"/>
<add key="PROVIDER" value="NONE"/>
<add key="DBTYPE" value="Oracle"/>
<add key="PERFORMANCE" value="High"/>
<add key="PASSWORD" value="password"/>
<add key="USERID" value="username"/>
<add key="CrystalImageCleaner-AutoStart" value="true"/>
<add key="CrystalImageCleaner-Sleep" value="60000"/>
<add key="CrystalImageCleaner-Age" value="120000"/>
</appSettings>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>
</pages>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<remove name="ScriptModule"/>
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Default.aspx.cs
namespace PresentationLayer
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
//open a session
NHibernate.Cfg.Configuration config = new NHibernate.Cfg.Configuration();
config.Configure();
//config.AddAssembly("DataTransfers");
ISessionFactory sessionFactory = config.BuildSessionFactory();
ISession session = sessionFactory.OpenSession();
IList enumIds = session.CreateCriteria(typeof(EnumsTable)).List();
ddlEnumsIds.DataSource = enumIds;
ddlEnumsIds.DataTextField = "enum_name";
ddlEnumsIds.DataValueField = "enum_id_pk";
ddlEnumsIds.DataBind();
session.Close();
}
}
}
}
Your xml doesn't seem to contain any nhibernate configuration information. There's no provider information or connection information that I can see. The config section should look like this
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.provider">
NHibernate.Connection.DriverConnectionProvider
</property>
<property name="dialect">
NHibernate.Dialect.Oracle10gDialect
</property>
<property name="connection.driver_class">
NHibernate.Driver.OracleDataClientDriver
</property>
<property name="connection.connection_string">
User Id=oe;
Password=oe;
Data Source=YOUR_TNS;
Pooling=true;
Enlist=false;
Statement Cache Size=50;
Min Pool Size=10;
Incr Pool Size=5;
Decr Pool Size=2;
</property>
<property name="show_sql">
true
</property>
<mapping assembly="NhbHelper"/>
</session-factory>
</hibernate-configuration>
One of the nice things with the newer version of NHibernate are the loqacious mapping and fluent configuration. it makes spinning up NHibernate a breeze. That code looks like this
Configure = new Configuration();
Configure.SessionFactoryName(System.Configuration.ConfigurationManager.AppSettings["SessionFactoryName"]);
Configure.DataBaseIntegration(db =>
{
db.Dialect<Oracle10gDialect>();
db.Driver<OracleDataClientDriver>();
db.KeywordsAutoImport = Hbm2DDLKeyWords.AutoQuote;
db.IsolationLevel = IsolationLevel.ReadCommitted;
db.ConnectionStringName = System.Environment.MachineName;
db.BatchSize = 20;
db.Timeout = 10;
db.HqlToSqlSubstitutions = "true 1, false 0, yes 'Y', no 'N'";
});
Configure.SessionFactory().GenerateStatistics();
Map();
Also look at the Oracle dialect. Guids are supported in Oracle as RAW(16). So it looks like you need to change your mapping for that field.

HttpContext.Current doesn't exist in IIS7 Integrated Mode

I just switched from Classic Mode to Integrated Mode and now HttpContext doesn't seem to exist in my ASP.NET application. I can't even add a Watch to HttpContext nor to HttpContext.Current.
I'm using FluorineFX where in the Web.config a HttpModule is defined. Apparently, in IIS7 Integrated Mode, these HttpModules need to be added to the Modules section in System.WebServer. I have done this, but now I'm having this HttpContext problem...
Any idea as why this could happen?
Code is in a simple service class being called by Flex (amf).
if (HttpContext.Current.User.Identity != null)
{
...
Web.Config (I don't know how to display this properly in Stack...):
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" requirePermission="false"/>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings, Microsoft.Practices.EnterpriseLibrary.Caching, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<sectionGroup name="fluorinefx">
<section name="settings" type="FluorineFx.Configuration.XmlConfigurator, FluorineFx" requirePermission="false"/>
</sectionGroup>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
</sectionGroup>
</configSections>
<cachingConfiguration configSource="WebCachingConfiguration.config"/>
<dataConfiguration defaultDatabase="ConnectionString"/>
<spring>
<context>
<resource uri="~/spring/Commands.xml"/>
<resource uri="~/spring/Management.xml"/>
<resource uri="~/spring/DomainModel.xml"/>
<resource uri="~/spring/Repositories.xml"/>
<resource uri="~/spring/Services.xml"/>
<resource uri="~/spring/MsmqQueues.xml"/>
<resource uri="~/spring/MsmqMessageQueueTemplates.xml"/>
<resource uri="~/spring/Jobs.xml"/>
</context>
</spring>
<log4net configSource="WebLog4Net.config"/>
<connectionStrings configSource="WebConnectionString.config"/>
<appSettings configSource="WebAppSettings.config"/>
<fluorinefx>
<settings configSource="WebFluorineFX.settings.config"/>
</fluorinefx>
<system.web>
<globalization culture="nl-BE"/>
<customErrors mode="RemoteOnly"/>
<compilation debug="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Messaging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies>
</compilation>
<authorization>
<allow users="*"/>
</authorization>
<!-- ignored when anonymous authentication is enabled in IIS -->
<authentication mode="Windows"/>
<identity impersonate="false"/>
<httpRuntime maxRequestLength="100000" executionTimeout="1800"/>
<caching>
<outputCache enableOutputCache="true"/>
<outputCacheSettings>
<outputCacheProfiles>
<add duration="500000" enabled="true" varyByParam="hashCode;thumb" name="AssetCacheProfile" noStore="false"/>
</outputCacheProfiles>
</outputCacheSettings>
</caching>
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>
</pages>
<sessionState timeout="20"/>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
<system.webServer>
<modules>
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="FluorineGateway" type="FluorineFx.FluorineGateway, FluorineFx"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated" />
<remove name="ScriptHandlerFactory" />
<remove name="ScriptHandlerFactoryAppServices" />
<remove name="ScriptResource" />
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<!-- Edumatic 3 Custom HttpHandlers -->
<add name="UploadUsers.aspx_*" path="UploadUsers.aspx" verb="*"
type="Edu3.Core.HttpHandler.UploadUsersHttpHandler, Edu3.Core"
preCondition="integratedMode,runtimeVersionv2.0" />
<add name="UploadItems.aspx_*" path="UploadItems.aspx" verb="*"
type="Edu3.Core.HttpHandler.UploadItemsHttpHandler, Edu3.Core"
preCondition="integratedMode,runtimeVersionv2.0" />
<add name="UploadBinaryAssetFile.aspx_*" path="UploadBinaryAssetFile.aspx" verb="*"
type="Edu3.Core.HttpHandler.UploadBinaryAssetFileHttpHandler, Edu3.Core"
preCondition="integratedMode,runtimeVersionv2.0" />
<add name="ExportSession.aspx_*" path="ExportSession.aspx" verb="*"
type="Edu3.Core.HttpHandler.ExportSessionHttpHandler, Edu3.Core"
preCondition="integratedMode,runtimeVersionv2.0" />
<add name="ExportSessions.aspx_*" path="ExportSessions.aspx" verb="*"
type="Edu3.Core.HttpHandler.ExportSessionsHttpHandler, Edu3.Core"
preCondition="integratedMode,runtimeVersionv2.0" />
<add name="ValidateSessions.aspx_*" path="ValidateSessions.aspx" verb="*"
type="Edu3.Core.HttpHandler.ValidateSessionsHttpHandler, Edu3.Core"
preCondition="integratedMode,runtimeVersionv2.0"/>
<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</handlers>
<caching>
<profiles>
<add extension=".swf" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="08:00:00" />
<add extension=".flv" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="08:00:00" />
<add extension=".gif" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="08:00:00" />
<add extension=".png" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="08:00:00" />
<add extension=".mp3" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="08:00:00" />
<add extension=".jpeg" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="08:00:00" />
<add extension=".jpg" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="08:00:00" />
</profiles>
</caching>
<urlCompression doStaticCompression="true" doDynamicCompression="true" />
</system.webServer>
<!-- ************************************************************************* -->
<!-- Runtime Section -->
<!-- Telerik needs this runtime declaration and maybe some of our custom pages -->
<!-- ************************************************************************* -->
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
If you are trying to access it from Application_Start there has been a architectural change that prevents this: IIS 7 Application_Start changes.
AFAIK it should exist everywhere else still.

Issue with hosting WCF service in IIS7

I have some issues with hosting a WCF service in IIS. The service was developed in VS2008(C#), and worked well when i hosted it in a console application However when i tried hosting it in IIS, I had issues.
Then I created a virtual directory and did the other stuff on IIS manager but came up with this error in my Mozilla browser.
Quote:
XML Parsing Error: no element found
Location: http://localhost/test1/Web.config
Line Number 1, Column 1:
I need some help on this guys. Thanks.
Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</controls>
</pages>
<httpHandlers>
<remove verb="*" path="*.svc" />
<add path="*.svc" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" validate="false"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpModules>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5" />
<providerOption name="WarnAsError" value="false" />
</compiler>
</compilers>
</system.codedom>
<system.web.extensions>
<scripting>
<webServices>
<!--
Uncomment this section to enable the authentication service. Include
requireSSL="true" if appropriate.
<authenticationService enabled="true" requireSSL = "true|false"/>
-->
<!--
Uncomment these lines to enable the profile service, and to choose the
profile properties that can be retrieved and modified in ASP.NET AJAX
applications.
<profileService enabled="true"
readAccessProperties="propertyname1,propertyname2"
writeAccessProperties="propertyname1,propertyname2" />
-->
<!--
Uncomment this section to enable the role service.
<roleService enabled="true"/>
-->
</webServices>
<!--
<scriptResourceHandler enableCompression="true" enableCaching="true" />
-->
</scripting>
</system.web.extensions>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated" />
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</handlers>
<directoryBrowse enabled="true" />
</system.webServer>
<services>
<service name="SendMsg.Service1" behaviorConfiguration="SendMsg.Service1Behavior">
<endpoint address="http://192.168.1.20:803/Service1.svc" binding="basicHttpBinding" contract="SendMsg.IService1" />
<host>
<baseAddresses>
<add baseAddress="http://192.168.1.20:803"/>
</baseAddresses>
</host>
<!--<endpoint address="net.tcp://localhost:8080/MyService/MathService.svc"
contract="IMathService"
binding="netTcpBinding"/>-->
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="SendMsg.Service1Behavior">
<serviceMetadata httpGetEnabled="True" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>

Resources