How to achieve URL rewrite in mvc3? - asp.net

My directory structure in MVC3 is below.
I installed URL-rewriting 2.0. I have added URL Rewriting.
Web.config
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=152368
-->
<configuration>
<configSections>
<sectionGroup name="elmah">
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
</sectionGroup>
<section name="dotless" type="dotless.Core.configuration.DotlessConfigurationSectionHandler, dotless.Core" />
<section name="combres" type="Combres.ConfigSectionSetting, Combres, Version=2.2, Culture=neutral, PublicKeyToken=1ca6b37997dd7536" />
<sectionGroup name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection, DotNetOpenAuth.Core">
<section name="messaging" type="DotNetOpenAuth.Configuration.MessagingElement, DotNetOpenAuth.Core" requirePermission="false" allowLocation="true" />
<section name="reporting" type="DotNetOpenAuth.Configuration.ReportingElement, DotNetOpenAuth.Core" requirePermission="false" allowLocation="true" />
<section name="openid" type="DotNetOpenAuth.Configuration.OpenIdElement, DotNetOpenAuth.OpenId" requirePermission="false" allowLocation="true" />
<section name="oauth" type="DotNetOpenAuth.Configuration.OAuthElement, DotNetOpenAuth.OAuth" requirePermission="false" allowLocation="true" />
</sectionGroup>
<section name="glimpse" type="Glimpse.Core.Configuration.Section, Glimpse.Core" />
</configSections>
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=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" />
<add key="elmah.mvc.disableHandler" value="false" />
<add key="elmah.mvc.disableHandleErrorFilter" value="false" />
<add key="elmah.mvc.requiresAuthentication" value="false" />
<add key="elmah.mvc.IgnoreDefaultRoute" value="false" />
<add key="elmah.mvc.allowedRoles" value="*" />
<add key="elmah.mvc.allowedUsers" value="*" />
<add key="elmah.mvc.route" value="elmah" />
<add key="CombresSectionName" value="combres" />
</appSettings>
<system.web>
<customErrors mode="RemoteOnly"></customErrors>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" />
</authentication>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear />
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear />
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
</providers>
</roleManager>
<pages>
<namespaces>
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages" />
<add namespace="Combres" />
<add namespace="Combres.Mvc" />
</namespaces>
</pages>
<httpHandlers>
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
<add path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler, dotless.Core" />
<add path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet" />
</httpHandlers>
<!-- Glimpse: This can be commented in to add additional data to the Trace tab when using WebForms
<trace writeToDiagnosticsTrace="true" enabled="true" pageOutput="false"/> -->
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
<add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet" />
</httpModules>
</system.web>
<system.webServer>
<rewrite>
<rules>
<rule name="WebFormToMyPage" stopProcessing="true">
<match url="^WEBFORM1.aspx" />
<action type="Redirect" url="MyDirectory/MyPage" appendQueryString="false" />
</rule>
</rules>
</rewrite>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
<add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet" preCondition="integratedMode" />
</modules>
<handlers>
<add name="dotless" path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler,dotless.Core" resourceType="File" preCondition="" />
<add name="Glimpse" path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet" preCondition="integratedMode" />
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="AjaxMin" publicKeyToken="21ef50ce11b5d80f" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.84.4790.14405" newVersion="4.84.4790.14405" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.2.13.0" newVersion="2.2.13.0" />
</dependentAssembly>
</assemblyBinding>
<!-- This prevents the Windows Event Log from frequently logging that HMAC1 is being used (when the other party needs it). -->
<legacyHMACWarning enabled="0" />
<!-- When targeting ASP.NET MVC 3, this assemblyBinding makes MVC 1 and 2 references relink
to MVC 3 so libraries such as DotNetOpenAuth that compile against MVC 1 will work with it.
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
-->
</runtime>
<elmah></elmah>
<dotless minifyCss="false" cache="true" web="false" />
<combres definitionUrl="~/App_Data/combres.xml" />
<system.net>
<defaultProxy enabled="true" />
<settings>
<!-- This setting causes .NET to check certificate revocation lists (CRL)
before trusting HTTPS certificates. But this setting tends to not
be allowed in shared hosting environments. -->
<!--<servicePointManager checkCertificateRevocationList="true"/>-->
</settings>
</system.net>
<dotNetOpenAuth>
<messaging>
<untrustedWebRequest>
<whitelistHosts>
<!-- Uncomment to enable communication with localhost (should generally not activate in production!) -->
<!--<add name="localhost" />-->
</whitelistHosts>
</untrustedWebRequest>
</messaging>
<!-- Allow DotNetOpenAuth to publish usage statistics to library authors to improve the library. -->
<reporting enabled="true" />
<!-- This is an optional configuration section where aspects of dotnetopenauth can be customized. -->
<!-- For a complete set of configuration options see http://www.dotnetopenauth.net/developers/code-snippets/configuration-options/ -->
<openid>
<relyingParty>
<security requireSsl="false">
<!-- Uncomment the trustedProviders tag if your relying party should only accept positive assertions from a closed set of OpenID Providers. -->
<!--<trustedProviders rejectAssertionsFromUntrustedProviders="true">
<add endpoint="https://www.google.com/accounts/o8/ud" />
</trustedProviders>-->
</security>
<behaviors>
<!-- The following OPTIONAL behavior allows RPs to use SREG only, but be compatible
with OPs that use Attribute Exchange (in various formats). -->
<add type="DotNetOpenAuth.OpenId.RelyingParty.Behaviors.AXFetchAsSregTransform, DotNetOpenAuth.OpenId.RelyingParty" />
</behaviors>
</relyingParty>
<provider></provider>
</openid>
</dotNetOpenAuth>
<uri>
<!-- The uri section is necessary to turn on .NET 3.5 support for IDN (international domain names),
which is necessary for OpenID urls with unicode characters in the domain/host name.
It is also required to put the Uri class into RFC 3986 escaping mode, which OpenID and OAuth require. -->
<idn enabled="All" />
<iriParsing enabled="true" />
</uri>
<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
<!-- If you are having issues with Glimpse, please include this. It will help us figure out whats going on.
<logging level="Trace" />-->
<!-- Want to use Glimpse on a remote server? Ignore the LocalPolicy by removing this comment.-->
<runtimePolicies>
<ignoredTypes>
<add type="Glimpse.AspNet.Policy.LocalPolicy, Glimpse.AspNet"/>
</ignoredTypes>
</runtimePolicies>
</glimpse>
</configuration>
When somebody is trying to type below url
http://localhost/webform1.aspx
It should be turned to like below...
http://localhost/MyDirectory/MyPage
How can i achieve this?

As far as I can tell, you actually want two things:
When a user navigates to /MyDirectory/MyPage you want to return whatever WebForm1.aspx renders.
When a user navigates to /WebForm1.aspx you want to redirect him to /MyDirectory/MyPage so that the URL in the address bar changes.
For the first one, add this route before your default route:
routes.MapPageRoute("MyPage", "MyDirectory/MyPage", "~/WebForm1.aspx");
This will make /MyDirectory/MyPage an alias to /WebForm1.aspx.
For the second one, add the following rewrite rule to the system.webServer section of your web.config file:
<rewrite>
<rules>
<rule name="WebFormToMyPage" stopProcessing="true">
<match url="^WebForm1.aspx" />
<action type="Redirect" url="MyDirectory/MyPage" />
</rule>
</rules>
</rewrite>

It sounds like you just want WebForm1.aspx to take you over to MyDirectory/MyPage. I would suggest redirecting the user to your new page:
<system.webServer>
<rewrite>
<rules>
<rule name="WebFormToMyPage" stopProcessing="true">
<match url="^webform1.aspx" />
<action type="Redirect" url="MyDirectory/MyPage" appendQueryString="false" />
</rule>
</rules>
</rewrite>

Related

Site moved to new server and this error appears: Hashed passwords cannot be retrieved

So I'm trying to move ASP.Net web site (DotNetNuke CMS) to a new web server. I have done this number of time's widauth any issues. This is the first time i get an error like this:
Configured settings are invalid: Hashed passwords cannot be retrieved. Either set the password format to different type, or set enablePasswordRetrieval to false.
Line 224: <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="SiteSqlServer" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="false" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="0" requiresUniqueEmail="false" passwordFormat="Hashed" applicationName="DotNetNuke" description="Stores and retrieves membership data from the local Microsoft SQL Server database" />
What have I done?
Created a backup of database.
Restore database on new server.
Created new user for database and tested it using MSSQL Management Studio.
Coppied files from old server.
Changed MSSQL Connection string (host,user,password,catalog)
Run site
This is where the error appears.
What have i discovered so for?
The error appears even if connectionString is removed from web.config!
machineKey is defined in web.config
Source server: Windows Server 2012 R2, MSSQL 12.0.4232, IIS 8.5.9600
Target server: Windows Server 2016, MSSQL 12.0.5203, IIS 10.0.14393
Multiple sites have been already moved from this same old server to new server without issues.
Can you help please?!
This is web.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="dotnetnuke">
<section name="data" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
<section name="logging" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
<section name="scheduling" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
<section name="htmlEditor" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
<section name="navigationControl" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
<section name="searchIndex" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
<section name="searchDataStore" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
<section name="friendlyUrl" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
<section name="caching" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
<section name="authentication" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
<section name="members" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
<section name="roles" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
<section name="profiles" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
<section name="permissions" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
<section name="moduleCaching" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
<section name="outputCaching" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
<section name="folder" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
<section name="clientcapability" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
<section name="sitemap" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
<section name="cryptography" requirePermission="false" type="DotNetNuke.Framework.Providers.ProviderConfigurationHandler, DotNetNuke" />
</sectionGroup>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor">
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor" requirePermission="false" />
</sectionGroup>
<section name="clientDependency" type="ClientDependency.Core.Config.ClientDependencySection, ClientDependency.Core" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="SiteSqlServer" connectionString="Data Source=172.10.10.110;Initial Catalog=DNN_*****;User ID=****;Password=****" providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="InstallTemplate" value="DotNetNuke.install.config" />
<add key="AutoUpgrade" value="true" />
<add key="UseInstallWizard" value="true" />
<add key="InstallMemberRole" value="true" />
<add key="ShowMissingKeys" value="false" />
<add key="EnableCachePersistence" value="false" />
<add key="HostHeader" value="" />
<add key="RemoveAngleBrackets" value="false" />
<add key="PersistentCookieTimeout" value="0" />
<add key="EnableServicesFrameworkTracing" value="false" />
<add key="InstallationDate" value="3/22/2013" />
<add key="UpdateServiceUrl" value="http://update.dotnetnuke.com" />
<add key="PreserveLoginUrl" value="true" />
<add key="loginUrl" value="~/Login.aspx" />
<add key="Telerik.Web.SkinsAssembly" value="Telerik.Web.UI.Skins, Version=2013.2.717.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4" />
<add key="InstallVersion" value="07.00.04" />
<add key="CertName" value="Lavrena3311_billing.pfx" />
<add key="CertPass" value="lavrenasms" />
<add key="DefaultDevicesDatabase" value="DesktopModules\DevicePreviewManagement\Resources\defaultDevices.xml" />
</appSettings>
<system.web.webPages.razor>
<pages pageBaseType="DotNetNuke.Web.Razor.DotNetNukeWebPage">
<namespaces>
<add namespace="WebMatrix.Data" />
<add namespace="Microsoft.Web.Helpers" />
</namespaces>
</pages>
</system.web.webPages.razor>
<system.webServer>
<modules>
<add name="RequestFilter" type="DotNetNuke.HttpModules.RequestFilter.RequestFilterModule, DotNetNuke.HttpModules" preCondition="managedHandler" />
<add name="UrlRewrite" type="DotNetNuke.HttpModules.UrlRewriteModule, DotNetNuke.HttpModules" preCondition="managedHandler" />
<add name="MobileRedirect" type="DotNetNuke.HttpModules.MobileRedirectModule, DotNetNuke.HttpModules" preCondition="managedHandler" />
<add name="Exception" type="DotNetNuke.HttpModules.Exceptions.ExceptionModule, DotNetNuke.HttpModules" preCondition="managedHandler" />
<add name="UsersOnline" type="DotNetNuke.HttpModules.UsersOnline.UsersOnlineModule, DotNetNuke.HttpModules" preCondition="managedHandler" />
<add name="DNNMembership" type="DotNetNuke.HttpModules.Membership.MembershipModule, DotNetNuke.HttpModules" preCondition="managedHandler" />
<add name="Personalization" type="DotNetNuke.HttpModules.Personalization.PersonalizationModule, DotNetNuke.HttpModules" preCondition="managedHandler" />
<add name="Analytics" type="DotNetNuke.HttpModules.Analytics.AnalyticsModule, DotNetNuke.HttpModules" preCondition="managedHandler" />
<add name="Services" type="DotNetNuke.HttpModules.Services.ServicesModule, DotNetNuke.HttpModules" />
<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
<add name="ClientDependencyModule" type="ClientDependency.Core.Module.ClientDependencyModule, ClientDependency.Core" />
<add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule, Telerik.Web.UI" preCondition="managedHandler" />
<add name="Detector" type="FiftyOne.Foundation.Mobile.Detection.DetectorModule, FiftyOne.Foundation" preCondition="managedHandler" />
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated" />
<add name="LogoffHandler*" path="Logoff.aspx" verb="*" type="DotNetNuke.Services.Authentication.LogOffHandler, DotNetNuke" preCondition="integratedMode" />
<add name="RSSHandler" path="RSS.aspx" verb="*" type="DotNetNuke.Services.Syndication.RssHandler, DotNetNuke" preCondition="integratedMode" />
<add name="LinkClickHandler" path="LinkClick.aspx" verb="*" type="DotNetNuke.Services.FileSystem.FileServerHandler, DotNetNuke" preCondition="integratedMode" />
<add name="CaptchaHandler" path="*.captcha.aspx" verb="*" type="DotNetNuke.UI.WebControls.CaptchaHandler, DotNetNuke" preCondition="integratedMode" />
<add name="UserProfilePageHandler" path="User.aspx" verb="*" type="DotNetNuke.Services.UserProfile.UserProfilePageHandler, DotNetNuke" preCondition="integratedMode" />
<add name="RadProgressHandler" verb="*" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.Upload.RadUploadProgressHandler, Telerik.Web.UI" preCondition="integratedMode" />
<add name="UserProfilePicHandler" path="ProfilePic.ashx" verb="*" type="DotNetNuke.Services.UserProfile.UserProfilePicHandler, DotNetNuke" preCondition="integratedMode" />
<remove name="ExtensionlessUrl-Integrated-4.0" />
<add name="ExtensionlessUrl-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
<add name="SitemapHandler" path="Sitemap.aspx" verb="*" type="DotNetNuke.Services.Sitemap.SitemapHandler, DotNetNuke" preCondition="integratedMode" />
<add name="ClientDependencyHandler" verb="*" path="DependencyHandler.axd" type="ClientDependency.Core.CompositeFiles.CompositeDependencyHandler, ClientDependency.Core" preCondition="integratedMode" />
<add name="Telerik.Web.UI.WebResource" verb="*" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" preCondition="integratedMode" />
<add name="Telerik.Web.UI.ChartHttpHandler" verb="*" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" />
<add name="HtmTemplateFileHandler" verb="*" path="*.htmtemplate" type="DotNetNuke.Providers.RadEditorProvider.HtmTemplateFileHandler, DotNetNuke.RadEditorProvider" preCondition="integratedMode" />
</handlers>
<validation validateIntegratedModeConfiguration="false" />
<security>
<requestFiltering>
<hiddenSegments>
<add segment="Documentation" />
<add segment="Licenses" />
</hiddenSegments>
</requestFiltering>
</security>
</system.webServer>
<system.web>
<machineKey validationKey="" decryptionKey="" decryption="3DES" validation="SHA1" />
<compilation debug="true" strict="false" targetFramework="4.0">
<buildProviders>
<remove extension=".resx" />
<remove extension=".resources" />
</buildProviders>
<assemblies>
<add assembly="Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add assembly="System.Transactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</assemblies>
<expressionBuilders>
<add expressionPrefix="dnnLoc" type="DotNetNuke.Services.Localization.LocalizationExpressionBuilder, DotNetNuke" />
</expressionBuilders>
</compilation>
<customErrors mode="Off" />
<authentication mode="Forms">
<forms name=".DOTNETNUKE" protection="All" timeout="60" cookieless="UseCookies" />
</authentication>
<httpRuntime shutdownTimeout="120" executionTimeout="900" useFullyQualifiedRedirectUrl="true" maxRequestLength="12288" requestLengthDiskThreshold="12288" requestValidationMode="2.0" fcnMode="Single" requestPathInvalidCharacters="<,>,*,%,:,\,?" />
<httpCookies httpOnlyCookies="true" requireSSL="false" domain="" />
<globalization culture="en-US" uiCulture="en" requestEncoding="UTF-8" responseEncoding="UTF-8" fileEncoding="UTF-8" />
<pages validateRequest="false" enableViewStateMac="true" enableEventValidation="true" viewStateEncryptionMode="Always">
<namespaces>
<add namespace="System.ComponentModel" />
<add namespace="System.Data" />
<add namespace="System.Data.SqlClient" />
<add namespace="System.Drawing" />
<add namespace="Microsoft.VisualBasic" />
<add namespace="System.Globalization" />
<add namespace="DotNetNuke.Services.Localization" />
<add namespace="DotNetNuke.Entities.Users" />
<add namespace="DotNetNuke" />
<add namespace="DotNetNuke.Common" />
<add namespace="DotNetNuke.Data" />
<add namespace="DotNetNuke.Framework" />
<add namespace="DotNetNuke.Modules" />
<add namespace="DotNetNuke.Security" />
<add namespace="DotNetNuke.Services" />
<add namespace="DotNetNuke.UI" />
<add namespace="DotNetNuke.Entities.Portals" />
<add namespace="DotNetNuke.Common.Utilities" />
<add namespace="DotNetNuke.Services.Exceptions" />
<add namespace="DotNetNuke.Entities.Tabs" />
</namespaces>
<controls></controls>
</pages>
<anonymousIdentification enabled="true" cookieName=".ASPXANONYMOUS" cookieTimeout="100000" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="None" domain="" />
<membership defaultProvider="AspNetSqlMembershipProvider" userIsOnlineTimeWindow="15">
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="SiteSqlServer" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="false" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="0" requiresUniqueEmail="false" passwordFormat="Hashed" applicationName="DotNetNuke" description="Stores and retrieves membership data from the local Microsoft SQL Server database" />
</providers>
</membership>
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin;bin\HttpModules;bin\Providers;bin\Modules;bin\Support;" />
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Telerik.Web.UI" publicKeyToken="121fae78165ba3d4" />
<bindingRedirect oldVersion="2008.0.0.0-2020.0.0.0" newVersion="2013.2.717.40" />
</dependentAssembly>
<dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity name="WebFormsMvp" publicKeyToken="537f18701145dff0" />
<bindingRedirect oldVersion="0.0.0.0-1.4.999.999" newVersion="1.4.1.0" />
</dependentAssembly>
<dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<dotnetnuke>
<htmlEditor defaultProvider="DotNetNuke.RadEditorProvider">
<providers>
<clear />
<add name="DotNetNuke.RadEditorProvider" type="DotNetNuke.Providers.RadEditorProvider.EditorProvider, DotNetNuke.RadEditorProvider" providerPath="~/DesktopModules/Admin/RadEditorProvider" />
</providers>
</htmlEditor>
<navigationControl defaultProvider="DNNMenuNavigationProvider">
<providers>
<clear />
<add name="DNNDropDownNavigationProvider" type="DotNetNuke.NavigationControl.DNNDropDownNavigationProvider, DotNetNuke.DNNDropDownNavigationProvider" providerPath="~\Providers\NavigationProviders\DNNDropDownNavigationProvider\" />
<add name="ASP2MenuNavigationProvider" type="DotNetNuke.NavigationControl.ASP2MenuNavigationProvider, DotNetNuke.ASP2MenuNavigationProvider" providerPath="~\Providers\NavigationProviders\ASP2MenuNavigationProvider\" />
<add name="DNNTreeNavigationProvider" type="DotNetNuke.NavigationControl.DNNTreeNavigationProvider, DotNetNuke.DNNTreeNavigationProvider" providerPath="~\Providers\NavigationProviders\DNNTreeNavigationProvider\" />
<add name="SolpartMenuNavigationProvider" type="DotNetNuke.NavigationControl.SolpartMenuNavigationProvider, DotNetNuke.SolpartMenuNavigationProvider" providerPath="~\Providers\NavigationProviders\SolpartMenuNavigationProvider\" />
<add name="DDRMenuNavigationProvider" type="DotNetNuke.Web.DDRMenu.DDRMenuNavigationProvider, DotNetNuke.Web.DDRMenu" />
<add name="DNNMenuNavigationProvider" type="DotNetNuke.NavigationControl.DNNMenuNavigationProvider, DotNetNuke.DNNMenuNavigationProvider" providerPath="~\Providers\NavigationProviders\DNNMenuNavigationProvider\" />
</providers>
</navigationControl>
<searchIndex defaultProvider="ModuleIndexProvider">
<providers>
<clear />
<add name="ModuleIndexProvider" type="DotNetNuke.Services.Search.ModuleIndexer, DotNetNuke" providerPath="~\Providers\SearchProviders\ModuleIndexer\" />
</providers>
</searchIndex>
<searchDataStore defaultProvider="SearchDataStoreProvider">
<providers>
<clear />
<add name="SearchDataStoreProvider" type="DotNetNuke.Services.Search.SearchDataStore, DotNetNuke" providerPath="~\Providers\SearchProviders\SearchDataStore\" />
</providers>
</searchDataStore>
<data defaultProvider="SqlDataProvider">
<providers>
<clear />
<add name="SqlDataProvider" type="DotNetNuke.Data.SqlDataProvider, DotNetNuke" connectionStringName="SiteSqlServer" upgradeConnectionString="" providerPath="~\Providers\DataProviders\SqlDataProvider\" objectQualifier="" databaseOwner="dbo" />
</providers>
</data>
<logging defaultProvider="DBLoggingProvider">
<providers>
<clear />
<add name="DBLoggingProvider" type="DotNetNuke.Services.Log.EventLog.DBLoggingProvider, DotNetNuke" providerPath="~\Providers\LoggingProviders\DBLoggingProvider\" />
</providers>
</logging>
<scheduling defaultProvider="DNNScheduler">
<providers>
<clear />
<add name="DNNScheduler" type="DotNetNuke.Services.Scheduling.DNNScheduler, DotNetNuke" providerPath="~\Providers\SchedulingProviders\DNNScheduler\" debug="false" maxThreads="1" />
</providers>
</scheduling>
<friendlyUrl defaultProvider="DNNFriendlyUrl">
<providers>
<clear />
<add name="DNNFriendlyUrl" type="DotNetNuke.Services.Url.FriendlyUrl.DNNFriendlyUrlProvider, DotNetNuke.HttpModules" includePageName="true" regexMatch="[^a-zA-Z0-9 _-]" urlFormat="humanfriendly" />
</providers>
</friendlyUrl>
<caching defaultProvider="FileBasedCachingProvider">
<providers>
<clear />
<add name="FileBasedCachingProvider" type="DotNetNuke.Services.Cache.FBCachingProvider, DotNetNuke" providerPath="~\Providers\CachingProviders\FileBasedCachingProvider\" />
</providers>
</caching>
<authentication defaultProvider="ADSIAuthenticationProvider">
<providers>
<clear />
<add name="ADSIAuthenticationProvider" type="DotNetNuke.Authentication.ActiveDirectory.ADSI.ADSIProvider, DotNetNuke.Authentication.ActiveDirectory" providerPath="~\Providers\AuthenticationProviders\ADSIProvider\" />
</providers>
</authentication>
<members defaultProvider="AspNetMembershipProvider">
<providers>
<clear />
<add name="AspNetMembershipProvider" type="DotNetNuke.Security.Membership.AspNetMembershipProvider, DotNetNuke" providerPath="~\Providers\MembershipProviders\AspNetMembershipProvider\" />
</providers>
</members>
<roles defaultProvider="DNNRoleProvider">
<providers>
<clear />
<add name="DNNRoleProvider" type="DotNetNuke.Security.Roles.DNNRoleProvider, DotNetNuke" providerPath="~\Providers\MembershipProviders\DNNMembershipProvider\" />
</providers>
</roles>
<profiles defaultProvider="DNNProfileProvider">
<providers>
<clear />
<add name="DNNProfileProvider" type="DotNetNuke.Security.Profile.DNNProfileProvider, DotNetNuke" providerPath="~\Providers\MembershipProviders\DNNProfileProvider\" />
</providers>
</profiles>
<permissions defaultProvider="CorePermissionProvider">
<providers>
<clear />
<add name="CorePermissionProvider" type="DotNetNuke.Security.Permissions.CorePermissionProvider, DotNetNuke" providerPath="~\Providers\PermissionProviders\CorePermissionProvider\" />
</providers>
</permissions>
<moduleCaching defaultProvider="FileModuleCachingProvider">
<providers>
<clear />
<add name="FileModuleCachingProvider" type="DotNetNuke.Services.ModuleCache.FileProvider, DotNetNuke" providerPath="~\Providers\ModuleCachingProviders\FileModuleCachingProvider\" />
<add name="MemoryModuleCachingProvider" type="DotNetNuke.Services.ModuleCache.MemoryProvider, DotNetNuke" providerPath="~\Providers\ModuleCachingProviders\MemoryModuleCachingProvider\" />
</providers>
</moduleCaching>
<outputCaching defaultProvider="FileOutputCachingProvider">
<providers>
<clear />
</providers>
</outputCaching>
<folder defaultProvider="StandardFolderProvider">
<providers>
<clear />
<add name="StandardFolderProvider" type="DotNetNuke.Services.FileSystem.StandardFolderProvider, DotNetNuke" />
<add name="SecureFolderProvider" type="DotNetNuke.Services.FileSystem.SecureFolderProvider, DotNetNuke" />
<add name="DatabaseFolderProvider" type="DotNetNuke.Services.FileSystem.DatabaseFolderProvider, DotNetNuke" />
</providers>
</folder>
<clientcapability defaultProvider="FiftyOneClientCapabilityProvider">
<providers>
<clear />
<add name="FiftyOneClientCapabilityProvider" type="DotNetNuke.Providers.FiftyOneClientCapabilityProvider.FiftyOneClientCapabilityProvider, DotNetNuke.Providers.FiftyOneClientCapabilityProvider" providerPath="~\Providers\ClientCapabilityProviders\FiftyOneClientCapabilityProvider\" />
</providers>
</clientcapability>
<sitemap defaultProvider="coreSitemapProvider">
<providers>
<clear />
<add name="coreSitemapProvider" type="DotNetNuke.Services.Sitemap.CoreSitemapProvider, DotNetNuke" providerPath="~\Providers\MembershipProviders\Sitemap\CoreSitemapProvider\" />
</providers>
</sitemap>
<cryptography defaultProvider="CoreCryptographyProvider">
<providers>
<clear />
<add name="CoreCryptographyProvider" type="DotNetNuke.Services.Cryptography.CoreCryptographyProvider, DotNetNuke" providerPath="~\Providers\CryptographyProviders\CoreCryptographyProvider\" />
</providers>
</cryptography>
</dotnetnuke>
<clientDependency version="0" fileDependencyExtensions=".js,.css">
<fileRegistration defaultProvider="DnnPageHeaderProvider">
<providers>
<add name="DnnBodyProvider" type="DotNetNuke.Web.Client.Providers.DnnBodyProvider, DotNetNuke.Web.Client" enableCompositeFiles="false" />
<add name="DnnPageHeaderProvider" type="DotNetNuke.Web.Client.Providers.DnnPageHeaderProvider, DotNetNuke.Web.Client" enableCompositeFiles="false" />
<add name="DnnFormBottomProvider" type="DotNetNuke.Web.Client.Providers.DnnFormBottomProvider, DotNetNuke.Web.Client" enableCompositeFiles="false" />
<add name="PageHeaderProvider" type="ClientDependency.Core.FileRegistration.Providers.PageHeaderProvider, ClientDependency.Core" enableCompositeFiles="false" />
<add name="LazyLoadProvider" type="ClientDependency.Core.FileRegistration.Providers.LazyLoadProvider, ClientDependency.Core" enableCompositeFiles="false" />
<add name="LoaderControlProvider" type="ClientDependency.Core.FileRegistration.Providers.LoaderControlProvider, ClientDependency.Core" enableCompositeFiles="false" />
</providers>
</fileRegistration>
<compositeFiles defaultFileProcessingProvider="DnnCompositeFileProcessor" compositeFileHandlerPath="~/DependencyHandler.axd">
<fileProcessingProviders>
<add name="CompositeFileProcessor" type="ClientDependency.Core.CompositeFiles.Providers.CompositeFileProcessingProvider, ClientDependency.Core" enableCssMinify="false" enableJsMinify="true" persistFiles="true" compositeFilePath="~/App_Data/ClientDependency" bundleDomains="" urlType="MappedId" />
<add name="DnnCompositeFileProcessor" type="DotNetNuke.Web.Client.Providers.DnnCompositeFileProcessingProvider, DotNetNuke.Web.Client" enableCssMinify="false" enableJsMinify="true" persistFiles="true" compositeFilePath="~/App_Data/ClientDependency" bundleDomains="" urlType="MappedId" />
</fileProcessingProviders>
</compositeFiles>
</clientDependency>
</configuration>
Did you try what the error message said? You have set enablePasswordRetrieval to true in your Web.Config. Try setting it to False
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" enablePasswordRetrieval="false" ... />
</providers>
I changed it to true on a local DNN installation and got the exact same error.
The issue ware missing files... Lost about 2 days for this :/ case closed. Thank you all for helping me!

ASP.NET MVC Publish to sub directory in ASP.NET WebForms gives Error 404

I have ASP.NET WebForms project in root directory working perfectly.
But now I have created my new project ASP.NET MVC and uploaded to mysite.com/subdirectory but I don't have access, it gives 404 - File or directory not found.
Here is my WebForms web.config in root directory:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="urlrewritingnet" restartOnExternalChanges="true" requirePermission="false" type="UrlRewritingNet.Configuration.UrlRewriteSection, UrlRewritingNet.UrlRewriter" />
<section name="microsoft.scripting" type="Microsoft.Scripting.Hosting.Configuration.Section, Microsoft.Scripting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=XXXXXXXXXXXX" requirePermission="false" />
<section name="clientDependency" type="ClientDependency.Core.Config.ClientDependencySection, ClientDependency.Core" />
<section name="Examine" type="Examine.Config.ExamineSettings, Examine" />
<section name="ExamineLuceneIndexSets" type="UmbracoExamine.Config.ExamineLuceneIndexes, UmbracoExamine" />
<section name="ImageGenConfiguration" type="ImageGen.ImageGenConfigurationHandler,ImageGen" />
</configSections>
<urlrewritingnet configSource="config\UrlRewriting.config" />
<microsoft.scripting configSource="config\scripting.config" />
<clientDependency configSource="config\ClientDependency.config" />
<Examine configSource="config\ExamineSettings.config" />
<ExamineLuceneIndexSets configSource="config\ExamineIndex.config" />
<appSettings>
<add key="umbracoConfigurationStatus" value="4.6.1" />
<add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/sqlmodifier.aspx" />
<add key="umbracoReservedPaths" value="~/umbraco,~/install/" />
<add key="umbracoContentXML" value="~/App_Data/umbraco.config" />
<add key="umbracoStorageDirectory" value="~/App_Data" />
<add key="umbracoPath" value="~/umbraco" />
<add key="umbracoEnableStat" value="false" />
<add key="umbracoHideTopLevelNodeFromPath" value="true" />
<add key="umbracoEditXhtmlMode" value="true" />
<add key="umbracoUseDirectoryUrls" value="true" />
<add key="umbracoDebugMode" value="false" />
<add key="umbracoTimeOutInMinutes" value="100" />
<add key="umbracoVersionCheckPeriod" value="7" />
<add key="umbracoDisableXsltExtensions" value="true" />
<add key="umbracoDefaultUILanguage" value="en" />
<add key="umbracoProfileUrl" value="profiler" />
<add key="umbracoUseSSL" value="false" />
<add key="umbracoUseMediumTrust" value="false" />
<!--
Set this to true to enable storing the xml cache locally to the IIS server even if the app files are stored centrally on a SAN/NAS
Alex Norcliffe 2010 02 for 4.1-->
<add key="umbracoContentXMLUseLocalTemp" value="false" />
</appSettings>
<system.net>
<mailSettings>
<smtp>
<!--<network host="127.0.0.1" userName="username" password="password" />-->
<network host="smtphost" port="25" defaultCredentials="false" />
</smtp>
</mailSettings>
</system.net>
<connectionStrings>
<remove name="LocalSqlServer" />
</connectionStrings>
<system.web>
<identity impersonate="false" />
<customErrors mode="Off" />
<trace enabled="true" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />
<machineKey decryptionKey=",IsolateApps" validationKey=",IsolateApps" />
<globalization requestEncoding="UTF-8" responseEncoding="UTF-8" />
<xhtmlConformance mode="Strict" />
<httpRuntime requestValidationMode="2.0" maxRequestLength="2000000" />
<pages validateRequest="false" enableEventValidation="false" viewStateEncryptionMode="Never">
<!-- ASPNETAJAX -->
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
<add tagPrefix="umbraco" namespace="umbraco.presentation.templateControls" assembly="umbraco" />
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
</controls>
</pages>
<httpModules>
<!-- URL REWRTIER -->
<add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
<add name="umbracoRequestModule" type="umbraco.presentation.requestModule" />
<!-- UMBRACO -->
<add name="viewstateMoverModule" type="umbraco.presentation.viewstateMoverModule" />
<add name="umbracoBaseRequestModule" type="umbraco.presentation.umbracobase.requestModule" />
<!-- ASPNETAJAX -->
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
<!-- CLIENT DEPENDENCY -->
<add name="ClientDependencyModule" type="ClientDependency.Core.Module.ClientDependencyModule, ClientDependency.Core" />
</httpModules>
<httpHandlers>
<remove verb="*" path="*.asmx" />
<!-- ASPNETAJAX -->
<add verb="*" path="*.asmx" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" validate="false" />
<add verb="*" path="*_AppService.axd" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" validate="false" />
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" validate="false" />
<!-- UMBRACO CHANNELS -->
<add verb="*" path="umbraco/channels.aspx" type="umbraco.presentation.channels.api, umbraco" />
<add verb="*" path="umbraco/channels/word.aspx" type="umbraco.presentation.channels.wordApi, umbraco" />
<add verb="*" path="DependencyHandler.axd" type="ClientDependency.Core.CompositeFiles.CompositeDependencyHandler, ClientDependency.Core " />
<add verb="GET,HEAD,POST" path="GoogleSpellChecker.ashx" type="umbraco.presentation.umbraco_client.tinymce3.plugins.spellchecker.GoogleSpellChecker,umbraco" />
<add path="MultipleFileUploadHandler.axd" verb="POST" type="noerd.Umb.DataTypes.multipleFileUpload.MultipleFileUploadHandler, noerd.Umb.DataTypes.multipleFileUpload" validate="False" />
</httpHandlers>
<compilation defaultLanguage="c#" debug="false" batch="false" targetFramework="4.0">
<assemblies>
<!-- ASP.NET 4.0 Assemblies -->
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
<add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
<add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
<add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
<add assembly="System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
</assemblies>
</compilation>
<authentication mode="Windows">
<forms name="yourAuthCookie" loginUrl="login.aspx" protection="All" path="/" />
</authentication>
<authorization>
<allow users="?" />
</authorization>
<!-- Membership Provider -->
<membership defaultProvider="UmbracoMembershipProvider" userIsOnlineTimeWindow="15">
<providers>
<clear />
<add name="UmbracoMembershipProvider" type="umbraco.providers.members.UmbracoMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Another Type" passwordFormat="Hashed" />
<add name="UsersMembershipProvider" type="umbraco.providers.UsersMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" passwordFormat="Hashed" />
</providers>
</membership>
<!-- added by NH to support membership providers in access layer -->
<roleManager enabled="true" defaultProvider="UmbracoRoleProvider">
<providers>
<clear />
<add name="UmbracoRoleProvider" type="umbraco.providers.members.UmbracoRoleProvider" />
</providers>
</roleManager>
<!-- Sitemap provider-->
<siteMap defaultProvider="UmbracoSiteMapProvider" enabled="true">
<providers>
<clear />
<add name="UmbracoSiteMapProvider" type="umbraco.presentation.nodeFactory.UmbracoSiteMapProvider" defaultDescriptionAlias="description" securityTrimmingEnabled="true" />
</providers>
</siteMap>
</system.web>
<!--</location>-->
<!-- ASPNETAJAX -->
<system.web.extensions>
<scripting>
<scriptResourceHandler enableCompression="true" enableCaching="true" />
</scripting>
</system.web.extensions>
<system.webServer>
<rewrite>
<rules>
<rule name="SpecificRedirect" stopProcessing="true">
<match url="^$" />
<action type="Redirect" url="/homepage" />
</rule>
</rules>
</rewrite>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<remove name="ScriptModule" />
<remove name="UrlRewriteModule" />
<remove name="umbracoRequestModule" />
<remove name="viewstateMoverModule" />
<remove name="umbracoBaseRequestModule" />
<remove name="ClientDependencyModule" />
<add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
<add name="umbracoRequestModule" type="umbraco.presentation.requestModule" />
<add name="viewstateMoverModule" type="umbraco.presentation.viewstateMoverModule" />
<add name="umbracoBaseRequestModule" type="umbraco.presentation.umbracobase.requestModule" />
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
<add name="ClientDependencyModule" type="ClientDependency.Core.Module.ClientDependencyModule, ClientDependency.Core" />
</modules>
<handlers accessPolicy="Read, Write, Script, Execute">
<remove name="WebServiceHandlerFactory-Integrated" />
<remove name="ScriptHandlerFactory" />
<remove name="ScriptHandlerFactoryAppServices" />
<remove name="ScriptResource" />
<remove name="Channels" />
<remove name="Channels_Word" />
<remove name="ClientDependency" />
<remove name="SpellChecker" />
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=" />
<add verb="*" name="Channels" preCondition="integratedMode" path="umbraco/channels.aspx" type="umbraco.presentation.channels.api, umbraco" />
<add verb="*" name="Channels_Word" preCondition="integratedMode" path="umbraco/channels/word.aspx" type="umbraco.presentation.channels.wordApi, umbraco" />
<add verb="*" name="ClientDependency" preCondition="integratedMode" path="DependencyHandler.axd" type="ClientDependency.Core.CompositeFiles.CompositeDependencyHandler, ClientDependency.Core " />
<add verb="GET,HEAD,POST" preCondition="integratedMode" name="SpellChecker" path="GoogleSpellChecker.ashx" type="umbraco.presentation.umbraco_client.tinymce3.plugins.spellchecker.GoogleSpellChecker,umbraco" />
<remove name="MultiFileUpload" /><add name="MultiFileUpload" path="MultipleFileUploadHandler.axd" verb="POST" type="noerd.Umb.DataTypes.multipleFileUpload.MultipleFileUploadHandler, noerd.Umb.DataTypes.multipleFileUpload" preCondition="integratedMode" />
</handlers>
</system.webServer>
<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="v4.0" />
<providerOption name="WarnAsError" value="false" />
</compiler>
</compilers>
</system.codedom>
<runtime>
<!-- Old asp.net ajax assembly bindings -->
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<ImageGenConfiguration configSource="config\ImageGen.config" />
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="default.aspx" />
<add value="Default.htm" />
<add value="Default.asp" />
<add value="index.htm" />
<add value="index.html" />
<add value="iisstart.htm" />
</files>
</defaultDocument>
<security>
<authentication>
<windowsAuthentication enabled="true" />
<anonymousAuthentication enabled="false" />
</authentication>
</security>
</system.webServer>
</configuration>
Although I haven't tried, I presume that the same Umbraco instance cannot handle both WebForms and MVC websites.
Here is an answer to the similar question with mixing MVC and WebForms in the same website. Hope this gives you a better insight in the problem.

Parser Error Message: The entry 'DefaultProfileProvider' has already been added

I have tried everything to fix this issue and cannot seem to get this error removed.
here is my web.config code:
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration,visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="glimpse" type="Glimpse.Core.Configuration.Section, Glimpse.Core" />
<section name="system.identityModel" type="System.IdentityModel.Configuration.SystemIdentityModelSection, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</configSections>
<connectionStrings>
<add name="MobileReportsEntities" connectionString="metadata=res://*/Models.MobileReports.csdl|res://*/Models.MobileReports.ssdl|res://*/Models.MobileReports.msl;provider=System.Data.SqlClient;provider connection string="data source=sqlgii02da1.dev.ardentmc.com\gii;initial catalog=MobileReports;User ID=MobileReports;Password=mobile;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
<add name="MacEntities" connectionString="metadata=res://*/Shared.Identity.Mac.csdl|res://*/Shared.Identity.Mac.ssdl|res://*/Shared.Identity.Mac.msl;provider=System.Data.SqlClient;provider connection string="data source=sqlirad01d.dev.ardentmc.com;initial catalog=Shared;persist security info=True;user id=IdentityClient;password=Id3ntityCli3nt;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="2.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="PreserveLoginUrl" value="true" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="logoLarge" value="~/Images/dhslogo.png" />
<add key="logoSmall" value="~/Images/dhslogo20x20.png" />
<add key="ApplicationUserGroup" value="Department of Homeland Security" />
<add key="ApplicationName" value="COP Mobile" />
<add key="ApplicationHeader" value="DHS COP Mobile" />
<add key="JQueryMobileCSS" value="~/Content/jquery.mobile.structure-1.3.0.css" />
<add key="JQueryMobileThemeCSS" value="~/Content/jquery.mobile.theme-1.3.0.css" />
<add key="ThemeCSS" value="~/Content/themes/dhs-jqm-theme-1.css" />
<add key="SiteCSS" value="~/Content/Site.css" />
<add key="JQueryJS" value="~/Scripts/jquery-1.9.1.js" />
<add key="JQueryUIJS" value="~/Scripts/jquery-ui-1.10.1.custom.js" />
<add key="JQueryMobileJS" value="~/Scripts/jquery.mobile-1.3.0.js" />
<add key="UtilitiesJS" value="~/Scripts/Utilities.js" />
<add key="HeaderActivationJS" value="~/Scripts/HeaderActivation.js" />
<add key="NavbarsJS" value="~/Scripts/Navbars.js" />
<add key="MobilePopupJS" value="~/Scripts/MobilePopup.js" />
<add key="LayersConfigFile" value="default_layers.xml"/>
<add key="ActiveIncidentsFeed" value="https://gii-dev.ardentmc.net/tokenauth/georss/COPLite/?token=446A6778-9F41-40ED-8A76-923E40B07CED" />
<add key="FeedRefreshInterval" value="180000"/>
<add key="FileDownloadPrefix" value="https://gii-dev.ardentmc.net/tokenauth/georss/CopLiteService/GetFile.ashx?token=446A6778-9F41-40ED-8A76-923E40B07CED&fileId=" />
<add key="GiiHome" value="https://gii-dev.ardentmc.net"/>
<add key="UseAuthentication" value="false" />
<add key="AuthenticationName" value="HSIN" />
<add key="ProxyUrl" value="" />
</appSettings>
<system.web>
<customErrors mode="Off" />
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
<httpRuntime maxRequestLength="102400" requestValidationMode="4.5" /> <!--targetFramework="4.5" **I took this out**-->
<machineKey compatibilityMode="Framework20SP1" validationKey="8A0FDB3F447F173B7D2821B17E41B3350733FE098D0B403F93C8E41269F57ADF88C6009A8F9071C3A7B1AF9382DAC219A3A5CE0BF0C8D2DA3E2ACBF155B87B5D" decryptionKey="15C8F55337FBC0FD7F83404F0BF6FA472614C94D1E6F3EB5" validation="SHA1" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" name=".GIIFORMSAUTH" protection="All" domain="ardentmc.com" />
</authentication>
<identity impersonate="true" />
<pages>
<namespaces>
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Optimization" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages" />
</namespaces>
</pages>
<profile defaultProvider="DefaultProfileProvider">
<providers>
<add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="MobileReportsEntities" applicationName="/" />
</providers>
</profile>
<membership defaultProvider="DefaultMembershipProvider">
<providers>
<add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="MobileReportsEntities" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
</providers>
</membership>
<roleManager defaultProvider="DefaultRoleProvider">
<providers>
<add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="MobileReportsEntities" applicationName="/" />
</providers>
</roleManager>
<sessionState mode="InProc" customProvider="DefaultSessionProvider" timeout="2880">
<providers>
<add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="MobileReportsEntities" />
</providers>
</sessionState>
<httpModules>
<add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet" />
</httpModules>
<httpHandlers>
<add path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet" />
</httpHandlers>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="Glimpse" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
<add name="Glimpse" path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet" preCondition="integratedMode" />
</handlers>
<modules>
<remove name="Glimpse" />
<add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet" preCondition="integratedMode" />
</modules>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
<legacyHMACWarning enabled="0" />
</runtime>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
</entityFramework>
<system.net>
<defaultProxy enabled="true" />
<settings>
<!-- This setting causes .NET to check certificate revocation lists (CRL)
before trusting HTTPS certificates. But this setting tends to not
be allowed in shared hosting environments. -->
<!--<servicePointManager checkCertificateRevocationList="true"/>-->
</settings>
</system.net>
<uri>
<!-- The uri section is necessary to turn on .NET 3.5 support for IDN (international domain names),
which is necessary for OpenID urls with unicode characters in the domain/host name.
It is also required to put the Uri class into RFC 3986 escaping mode, which OpenID and OAuth require. -->
<idn enabled="All" />
<iriParsing enabled="true" />
</uri>
<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
<!-- If you are having issues with Glimpse, please include this. It will help us figure out whats going on.
<logging level="Trace"/>-->
<!-- Want to use Glimpse on a remote server? Ignore the LocalPolicy by removing this comment.
<runtimePolicies>
<ignoredTypes>
<add type="Glimpse.AspNet.Policy.LocalPolicy, Glimpse.AspNet"/>
</ignoredTypes>
</runtimePolicies>-->
</glimpse>
<system.identityModel>
<identityConfiguration>
<claimsAuthenticationManager type="ArdentMC.Security.Identity.ClaimsManager, ArdentMC.Security.Identity"/>
<claimsAuthorizationManager type="ArdentMC.Security.Identity.AccessManager, ArdentMC.Security.Identity" />
<claimsAuthenticationManager type="ArdentMC.Security.Identity.ClaimsManager, ArdentMC.Security.Identity" />
</identityConfiguration>
</system.identityModel>
</configuration>
does anyone have any idea how to fix this error message i keep getting?
any advice or help would be greatly appreciated.
thank you in advance.
I fixed the issues. i was using visual studio to ghold multiple projects and my web config file was overlapping with another project i had in visual studio...i just needed to disconnect the project i wasnt using and that fixed the duplication errors.

Trying to deploy MVC 3 application using shared hosting, getting 403 - Forbidden: Access is denied

In the control panel I can see that I am using IIS7.5, ASP.NET Version 4.
I have all the MVC3 dependencies in the /BIN folder too. The root folder has correct file access [read only] and I would think the host sets all the users access privillages for all the IIS services/users etc.
Folder structure.
-HTTPROOT
Content
Scripts
Views
bin
cleditor
colorbox
slider
treeview
The web.config is below
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<section name="resizer" type="ImageResizer.ResizerSection" />
</configSections>
<connectionStrings>
<add name="wwdbEntities" connectionString="metadata=res://*/Models.entitymodel.wwModel.csdl|res://*/Models.entitymodel.wwModel.ssdl|res://*/Models.entitymodel.wwModel.msl;provider=System.Data.SqlClient;provider connection string="data source=ms-someserver.com;Initial Catalog=myDbname;User Id=XXXXX;Password=XXXXXXbwrt;integrated security=False;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="1.0.0.0" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="false" />
</appSettings>
<system.web>
<compilation debug="false" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880">
<credentials passwordFormat="Clear">
<user name="admin" password="xxxxxxx" />
</credentials>
</forms>
</authentication>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear />
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear />
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
</providers>
</roleManager>
<pages>
<namespaces>
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages" />
</namespaces>
</pages>
<httpModules>
<add name="ImageResizingModule" type="ImageResizer.InterceptModule" />
</httpModules>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<add name="ImageResizingModule" type="ImageResizer.InterceptModule" />
</modules>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameters>
<parameter value="somesqlserver.com; Integrated Security=False; MultipleActiveResultSets=True" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
<resizer>
<plugins>
<add name="MvcRoutingShim" />
</plugins>
</resizer>
</configuration>
You may want to check the following:
See if you have Anonymous authentication enabled in IIS.
Since you are in a shared environment this should already be true, however it might be worth checking.
Check whether the default document is enabled in IIS.
Even though this is an MVC application and you may think there is no default file, you still need to make sure you enabled "default.aspx" as your default document.

WCF Data Service returns 400 Bad Request for POST queries

I need to host a WCF Data service as part of a legacy ASP.NET MVC website running in IIS 7 Integrated mode.
Read access to the web service is working fine, but whenever I try to POST to the web service, I get a 400 Bad Request error.
For testing purposes, I have downloaded the sample odata service from http://www.odata.org/developers/odata-sdk#/media/7582/odatasampleservices.zip. Posting to that webservice works fine when running it in a separate IIS website. However, when I put it in my legacy website, I am geting that 400 Bad Request error wen sending a post request to the service again.
Therefore the problem seems to be related to the configuration of my ASP.NET MVC project. However, I am at a loss on how to proceed.
This is the web config file I am using in my legacy project:
<?xml version="1.0" encoding="utf-8"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->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
-->
<configuration>
<configSections>
<section name="combres" type="Combres.ConfigSectionSetting, Combres" />
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net" />
<sectionGroup name="elmah">
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
<section name="errorMailSAZ" requirePermission="false" type="ElmahFiddler.ElmahMailSAZSectionHandler, ElmahFiddler" />
</sectionGroup>
</configSections>
<combres definitionUrl="~/App_Data/combres.xml" />
<log4net>
<root>
<level value="ALL" />
<appender-ref ref="RollingFile" />
</root>
<logger name="Combres">
<level value="DEBUG" />
</logger>
<appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
<file value="log.txt" />
<appendToFile value="true" />
<maximumFileSize value="100KB" />
<maxSizeRollBackups value="2" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%d [%t] %-5p %c - %m%n" />
</layout>
</appender>
</log4net>
<appSettings configSource="appSettings.config" />
<connectionStrings configSource="connectionstrings.config">
</connectionStrings>
<!-- Mail server settings-->
<system.net>
<mailSettings/>
</system.net>
<system.web>
<globalization uiCulture="de" culture="de-DE" />
<compilation debug="true">
<assemblies>
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<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>
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</buildProviders>
</compilation>
<authentication mode="Forms">
<!-- User muessen sich nach 30 Tagen abwesenheit neu einloggen (wenn remember me angeklickt wird)-->
<forms loginUrl="~/Profile/LogOn" timeout="43200" slidingExpiration="true" />
</authentication>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="500" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear />
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ApplicationServices" applicationName="/" />
</providers>
</profile>
<roleManager enabled="true">
<providers>
<clear />
<add connectionStringName="ApplicationServices" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add applicationName="/" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</roleManager>
<customErrors configSource="customErrors.config" />
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Linq" />
<add namespace="System.Collections.Generic" />
<add namespace="xVal.Html" />
<add namespace="Zeiterfassung.Views" />
<add namespace="Zeiterfassung.Models" />
<add namespace="Zeiterfassung" />
<add namespace="GrigoreComponents.Generic" />
<add namespace="DeverMind.Generic" />
<!--<add namespace="MvcContrib.UI.Grid.ActionSyntax" />-->
</namespaces>
</pages>
<httpHandlers>
<add path="captcha.ashx" verb="GET" type="ManagedFusion.Web.Mvc.Handlers.CaptchaImageHandler, ManagedFusion, Version=1.0.3490.29346, Culture=neutral" validate="false" />
<add path="*.mvc" verb="*" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" validate="false" />
<!--<add path="VSEnterpriseHelper.axd" verb="GET" type="Microsoft.VisualStudio.Enterprise.Common.AspNetHelperHandler, Microsoft.VisualStudio.Enterprise.ASPNetHelper, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />-->
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" />
<add path="/elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" />
</httpHandlers>
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
</httpModules>
</system.web>
<system.web.extensions>
<scripting>
<webServices>
<authenticationService enabled="true" requireSSL="false" />
</webServices>
</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 runAllManagedModulesForAllRequests="true">
<add name="Elmah.ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="Elmah.ErrorFilter" type="Elmah.ErrorFilterModule" preCondition="managedHandler" />
<add name="Elmah.ErrorMail" type="Elmah.ErrorMailModule" preCondition="managedHandler" />
<add name="elmahSAZ" type="ElmahFiddler.ElmahMailSAZTraceModule, ElmahFiddler" />
</modules>
<handlers>
<add name="Elmah" path="elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
<remove name="MvcHttpHandler" />
<remove name="UrlRoutingHandler" />
<add name="MvcHttpHandler" preCondition="integratedMode" verb="*" path="*.mvc" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" />
<!--<add name="VSEnterpriseHelper.axd" verb="GET" path="VSEnterpriseHelper.axd" preCondition="integratedMode" type="Microsoft.VisualStudio.Enterprise.Common.AspNetHelperHandler, Microsoft.VisualStudio.Enterprise.ASPNetHelper, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>-->
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>
<!--404 fehler sind was besonderes, ich will sie nicht in elmah sehen und ausserdem funktioniert es aus unbekannten gruenden eh nicht wenn ich sie auf dem hetzner-server per
customerrors handle-->
<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/Error/FileNotFound" responseMode="ExecuteURL" />
</httpErrors>
<staticContent>
<!--cache static content on the client side for 7 days-->
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
</staticContent>
<rewrite>
<rules>
<rule name="CanonicalHostName-Adrian" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^worklogger\.de:4567$" />
</conditions>
<action type="Redirect" url="http://www.worklogger.de:4567/{R:1}" />
</rule>
<rule name="CanonicalHostName-Sandra" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^worklogger\.de:7654$" />
</conditions>
<action type="Redirect" url="http://www.worklogger.de:7654/{R:1}" />
</rule>
<rule name="CanonicalHostName-Production" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^logmytime\.de$" />
</conditions>
<action type="Redirect" url="http://www.logmytime.de/{R:1}" />
</rule>
<rule name="RemoveTrailingSlashRule1" enabled="true" stopProcessing="true">
<match url="(.*)/$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Redirect" url="{R:1}" />
</rule>
<rule name="Rewrite rule for RewriteMap" enabled="true" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{RewriteMap:{REQUEST_URI}}" pattern="(.+)" />
</conditions>
<action type="Redirect" url="{C:1}" appendQueryString="false" />
</rule>
<rule name="jquery-UI images" enabled="true" stopProcessing="true">
<match url="(.*)combres.axd/UserAreaCSS/images/(.*)" />
<conditions logicalGrouping="MatchAny"></conditions>
<action type="Rewrite" url="Scripts/jquery-ui/css/custom-theme/images/{R:2}" />
</rule>
<rule name="Add API trailing slash without redirecting the user to a different domain" enabled="false" patternSyntax="ExactMatch" stopProcessing="true">
<match url="API/V1/APi.svc" />
<action type="Redirect" url="API/V1/APi.svc/" redirectType="Permanent" />
</rule>
</rules>
<rewriteMaps>
<rewriteMap name="RewriteMap">
<add key="/Zeiterfassung/zeiterfassungssoftware.html" value="/Zeiterfassung/Arbeitszeit/Zeiterfassungssoftware" />
</rewriteMap>
</rewriteMaps>
</rewrite>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.Enterprise.ASPNetHelper" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<codeBase version="9.0.0.0" href="file:///C:/Program%20Files%20(x86)/Microsoft%20Visual%20Studio%209.0/Common7/IDE/PrivateAssemblies/Microsoft.VisualStudio.Enterprise.ASPNetHelper.DLL" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.Enterprise.ASPNetHelper" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<codeBase version="9.0.0.0" href="file:///C:/Program%20Files%20(x86)/Microsoft%20Visual%20Studio%209.0/Common7/IDE/PrivateAssemblies/Microsoft.VisualStudio.Enterprise.ASPNetHelper.DLL" />
</dependentAssembly>
<dependentAssembly xmlns="">
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<location path="VSEnterpriseHelper.axd">
<system.web>
<authorization>
<allow users="?" />
</authorization>
</system.web>
</location>
<!-- Deny everyone except siteadmins to see the elmah.axd -->
<location path="elmah.axd">
<system.web>
<authorization>
<allow roles="SiteAdmin" />
<deny users="*" />
</authorization>
</system.web>
</location>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>
</configuration>
Thanks for your help,
Adrian
Edit: Not sure if it's any helpe, but here's the fiddler output and the failed request trace:
> curl -u login:pass
> "http://www.worklogger.de:4567/Testapi/Testapi.svc/Projects"
> -v -d test
> * About to connect() to www.worklogger.de port 4567 (#0)
> * Trying 192.168.0.109... connected
> * Connected to www.worklogger.de (192.168.0.109) port 4567 (#0)
> * Server auth using Basic with user 'login'
> POST /Testapi/Testapi.svc/Projects HTTP/1.1
> Authorization: Basic bG9naW46cGFzcw==
> User-Agent: curl/7.19.0 (i686-suse-linux-gnu) libcurl/7.19.0 OpenSSL/0.9.8h zlib/1.2.3 libidn/1.10
> Host: www.worklogger.de:4567
> Accept: */*
> Content-Length: 4
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 400 Bad Request
< Cache-Control: private
< Server: Microsoft-IIS/7.5
< X-AspNet-Version: 4.0.30319
< Set-Cookie: ASP.NET_SessionId=arrujp3wazcugm55v4ysyuew; path=/; HttpOnly
< X-Powered-By: ASP.NET
< Date: Sun, 27 Jun 2010 13:24:05 GMT
< Content-Length: 0
<
* Connection #0 to host www.worklogger.de left intact
* Closing connection #0
I saved the failed request trace to pastebin to http://pastebin.com/K3uEZfVS since StackOverflow does not allow posts to grow over 50k.
Edit2: I would like to point out again that the very same web service runs fine (both POST and GET!) when putting it in a brandnew ASP.NET MVC website with no other changes. Therefore the problem cannot be related to the way I am making the request.
Have you tried setting aspNetCompatibilityEnabled to false, in the web.config you posted above?
If the corresponding attribute is not set in the code of the WCF service(it's default is AspNetCompatibilityRequirementsMode.NotAllowed) the service denies calls from any client that has aspNetCompatibilityEnabled set to true.
If that setting was the problem, here
is the long term fix, I have added
the attribute
[AspNetCompatibilityRequirements(RequirementsMode
= AspNetCompatibilityRequirementsMode.Allowed)]
to my WCF service class
I worked around the problem by implementing a proxy to the web service: http://code.google.com/p/fastajaxproxy/
Disable WebDav in IIS. It Worked for me... Most at times, post methods are used to perform delete or put operations. Disabling this enables post to perform delete and put operations
If you're posting files, have a look at the settings proposed in this question: WCF problem with uploading large file, hosted in IIS
(and following answer).
Hope this helps
Which O/S is this service hosted on ?
If its Vista or above, you can use FREB to decode what failed in the pipeline.
http://learn.iis.net/page.aspx/266/troubleshooting-failed-requests-using-tracing-in-iis-7/
Can you run Fiddler to identify what the HTTP error response from the server is ?

Resources