I have followed the following post Nuget Config.Transform Formatting Issue to add web.config file entries in NuGet.
I have used the below xdt file in my NuGet package
<compilation>
<assemblies>
<add assembly="ASSEMBLY1, Version=1.0.10, Culture=neutral" xdt:Transform="Insert"/>
<add assembly="ASSEMBLY2, Version=1.0.11, Culture=neutral" xdt:Transform="Insert"/>
<add assembly="ASSEMBLY3, Version=1.0.12, Culture=neutral" xdt:Transform="Insert"/>
<add assembly="ASSEMBLY4, Version=1.0.13, Culture=neutral" xdt:Transform="Insert"/>
</assemblies>
</compilation>
</system.web>
and i have tried to install this NuGet am getting the following error. Error An error occurred while applying transformation to 'web.config' in project 'WebApplication60' No element in the source document matches '/configuration/system.web/compilation/assemblies/add' 0
Since the assemblies node was not found in the project. I have tried to add xdt:Transform="Insert" to assemblies node, but it causes duplicate entries in web.configfile like below
<assemblies>
<add assembly="ASSEMBLY1, Version=1.0.10, Culture=neutral" xdt:Transform="Insert"/>
<add assembly="ASSEMBLY2, Version=1.0.11, Culture=neutral" xdt:Transform="Insert"/>
<add assembly="ASSEMBLY3, Version=1.0.12, Culture=neutral" xdt:Transform="Insert"/>
<add assembly="ASSEMBLY4, Version=1.0.13, Culture=neutral" xdt:Transform="Insert"/>
<add assembly="ASSEMBLY1, Version=1.0.10, Culture=neutral" xdt:Transform="Insert"/>
<add assembly="ASSEMBLY2, Version=1.0.11, Culture=neutral" xdt:Transform="Insert"/>
<add assembly="ASSEMBLY3, Version=1.0.12, Culture=neutral" xdt:Transform="Insert"/>
<add assembly="ASSEMBLY4, Version=1.0.13, Culture=neutral" xdt:Transform="Insert"/>
</assemblies>
How to avoid this duplicate entries?
To avoid inserting duplicate entries, you can try to remove assemblies element first, if any, then insert a new one which has been populated with <add assembly=""/> elements afterwards :
<compilation>
<assemblies xdt:Transform="Remove"/>
<assemblies xdt:Transform="Insert">
<add assembly="ASSEMBLY1, Version=1.0.10, Culture=neutral"/>
<add assembly="ASSEMBLY2, Version=1.0.11, Culture=neutral"/>
<add assembly="ASSEMBLY3, Version=1.0.12, Culture=neutral"/>
<add assembly="ASSEMBLY4, Version=1.0.13, Culture=neutral"/>
</assemblies>
</compilation>
Or, you can try using InsertIfMissing transform to insert while an element and avoid duplicate in case it already exists :
<compilation>
<assemblies xdt:Transform="InsertIfMissing">
<add assembly="ASSEMBLY1, Version=1.0.10, Culture=neutral"
xdt:Transform="InsertIfMissing" xdt:Locator="Match(assembly)"/>
<add assembly="ASSEMBLY2, Version=1.0.11, Culture=neutral"
xdt:Transform="InsertIfMissing" xdt:Locator="Match(assembly)"/>
<add assembly="ASSEMBLY3, Version=1.0.12, Culture=neutral"
xdt:Transform="InsertIfMissing" xdt:Locator="Match(assembly)"/>
<add assembly="ASSEMBLY4, Version=1.0.13, Culture=neutral"
xdt:Transform="InsertIfMissing" xdt:Locator="Match(assembly)"/>
</assemblies>
</compilation>
Related
After upgrading the ServiceStack libraries on my website from 3.9.71 to 4.0.33, I noticed that ServiceStack.Razor is no longer rendering pages correctly. It appears to not be reading the layout.cshtml file. The pages load without the layout and without an error or warning. I've tried putting the layout.cshtml file in /Views/_layout.cshtml and /Views/Shared/_layout.cshtml.
In addition to replacing the packages during the upgrade, I also made the necessary changes to the Web.config file. Here is a snippet from my Web.config file. Please let me know if this is helpful or if I need to provide other information. Any help would be appreciated.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor" requirePermission="false" />
</sectionGroup>
</configSections>
<appSettings>
<add key="webPages:Enabled" value="false" />
<add key="servicestack:license" value="{LICENSE_KEY_HERE}" />
</appSettings>
<system.webServer>
<handlers>
<remove name="ChartImageHandler" />
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.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" />
</handlers>
<modules>
<add name="RightsModule" type="UI.security.RightsHttpModule" />
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</modules>
<validation validateIntegratedModeConfiguration="false" />
<rewrite>
<rules>
<rule name="Redirect domain.com to www" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions>
<add input="{HTTP_HOST}" pattern="www.google.com" />
</conditions>
<action type="Redirect" url="http://google.com/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
<!-- Required for MONO -->
<system.web>
<httpRuntime executionTimeout="3600" maxRequestLength="1048576" />
<httpModules>
<add name="RightsModule" type="UI.security.RightsHttpModule" />
<add name="Airbrake" type="SharpBrake.NotifierHttpModule, SharpBrake" />
</httpModules>
<httpHandlers>
<!-- razor -->
<add path="*" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*" />
<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="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
</httpHandlers>
<globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" />
<compilation targetFramework="4.5.1" debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<!-- add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/ -->
</assemblies>
<buildProviders>
<add extension=".cshtml" type="ServiceStack.Razor.CSharpRazorBuildProvider, ServiceStack.Razor" />
</buildProviders>
</compilation>
<authentication mode="Forms">
<forms loginUrl="/optimize/login.cshtml" protection="All" timeout="1440" name="AudiencePoint" path="/app" requireSSL="false" slidingExpiration="true" defaultUrl="/optimize" cookieless="UseCookies" enableCrossAppRedirects="false" />
</authentication>
<authorization>
<allow users="*" />
</authorization>
</system.web>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc" />
<pages pageBaseType="ServiceStack.Razor.ViewPage">
<namespaces>
<add namespace="ServiceStack.Html" />
<add namespace="ServiceStack.Razor" />
<add namespace="ServiceStack.Text" />
<add namespace="ServiceStack.OrmLite" />
<add namespace="UI" />
<add namespace="System" />
<add namespace="ServiceStack" />
</namespaces>
</pages>
</system.web.webPages.razor>
<location path="optimize">
<system.web>
<httpHandlers>
<add path="*" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*" />
</httpHandlers>
</system.web>
<!-- Required for IIS 7.0 -->
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<add path="*" name="ServiceStack.Factory" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" />
</handlers>
</system.webServer>
</location>
</configuration>
Looks like the issue was that my code used the ServiceStack.Service.GetSession() method instead of the ServiceStack.Service.SessionAs() method to retrieve the UserSession. Not sure why this worked in 3.9.x but after I changed it, it started rendering in 4.0.x.
For the difference between the two methods checkout this stackoverflow question. They can't be used interchangeably.
Ok..I know this is asked many times and I looked bunch of questions and answers about this and nothing worked for me and I am getting crazy. I am trying to put elmah to my asp.net mvc 5 application and I can't get it to work. I keep getting not found error.
My config for elmah is:
<appSettings>
<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" />
</appSettings>
<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>
<system.web>
<customErrors mode="On"></customErrors>
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
</httpModules>
<httpHandlers>
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</httpHandlers>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<add name="Elmah" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</handlers>
<modules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
<!--<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" />-->
</modules>
</system.webServer>
<elmah>
<security allowRemoteAccess="1" />
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data/elmah" />
</elmah>
and yes i have ignored .axd in my rout config..
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
What am I missing ??
You need to create a MIME type for that extension in IIS:
To define a MIME type for a specific extension, follow these steps:
Open the IIS Microsoft Management Console (MMC), right-click the local computer name, and then click Properties.
Click HTTP Headers.
Click MIME Types.
Click New.
In the Extension box, type the file name extension that you want (for example, .axed)
In the MIME Type box, type application/octet-stream.
Apply the new settings. Note that you must restart the World Wide Web Publishing Service or wait for the worker process to recycle for the changes to take effect. In this example, IIS now serves files with the .axed extension.
I have been working on converting an asp.net application to a windows azure application. I managed to get it to work however I have been messing around with the webconfig so much that now I cannot get it back to working offline :P
I configured it with ACS but I can't seem to have it disabled.
EDIT:
here is my 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=169433
-->
<configuration>
<configSections>
<section name="microsoft.identityModel" type="Microsoft.IdentityModel.Configuration.MicrosoftIdentityModelSection, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=asdfasdfsdfsdf" />
</configSections>
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.7.0.0, Culture=neutral, PublicKeyToken=sadfasdfsadfasdf" name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
<add name="DefaultConnection" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet_aa8d9cfe6be24b4aa01a7c093647b6df;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
</connectionStrings>
<location path="FederationMetadata">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<system.web>
<httpRuntime requestValidationMode="2.0" />
<authorization>
<deny users="?" />
</authorization>
<authentication mode="None" />
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=asdfasdfsdafsdf" />
</assemblies>
</compilation>
<!--Commented out by FedUtil-->
<!--<authentication mode="Forms"><forms loginUrl="~/Account/Login.aspx" timeout="2880" /></authentication>-->
<membership defaultProvider="DefaultMembershipProvider">
<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="/" />
<add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=asdfasdfsdafsdafasd" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
</providers>
</membership>
<profile defaultProvider="DefaultProfileProvider">
<providers>
<clear />
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
<add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=asdfasdfsdafasd" connectionStringName="DefaultConnection" applicationName="/" />
</providers>
</profile>
<roleManager enabled="false" defaultProvider="DefaultRoleProvider">
<providers>
<clear />
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
<add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=sadfsadfasdfasdfasdf" connectionStringName="DefaultConnection" applicationName="/" />
</providers>
</roleManager>
<sessionState mode="InProc" customProvider="DefaultSessionProvider">
<providers>
<add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=asdfsdafsdafasdf" connectionStringName="DefaultConnection" applicationName="/" />
</providers>
</sessionState>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="WSFederationAuthenticationModule" type="Microsoft.IdentityModel.Web.WSFederationAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=asdfsdafasdfasdf" preCondition="managedHandler" />
<add name="SessionAuthenticationModule" type="Microsoft.IdentityModel.Web.SessionAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=sadfasdfsdfsdfasdf" preCondition="managedHandler" />
</modules>
<handlers>
<add name="ChartHandles" path="ChartImage.axd" verb="*" type="Telerik.Web.UI.ChartHttpHandler, Telerik.Web.UI, Version=2009.2.826.20, Culture=neutral, PublicKeyToken=sadfasdfsdafsdafas" />
<add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />
</handlers>
</system.webServer>
<appSettings>
<add key="FederationMetadataLocation" value="https://timecontrol.accesscontrol.windows.net/FederationMetadata/2007-06/FederationMetadata.xml " />
</appSettings>
<microsoft.identityModel>
<service>
<audienceUris>
<add value="http://127.0.0.1:81/" />
</audienceUris>
<applicationService>
<claimTypeRequired>
<!--Following are the claims offered by STS 'https://timecontrol.accesscontrol.windows.net/'. Add or uncomment claims that you require by your application and then update the federation metadata of this application.-->
<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name" optional="true" />
<claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/role" optional="true" />
<!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier" optional="true" />-->
<!--<claimType type="http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider" optional="true" />-->
</claimTypeRequired>
</applicationService>
<certificateValidation certificateValidationMode="None" />
<federatedAuthentication>
<wsFederation passiveRedirectEnabled="true" issuer="https://timecontrol.accesscontrol.windows.net/v2/wsfederation" realm="http://127.0.0.1:81/" requireHttps="false" />
<cookieHandler requireSsl="false" />
</federatedAuthentication>
<issuerNameRegistry type="Microsoft.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=sdfsadfasdfasdfasd">
<trustedIssuers>
<add thumbprint="sadfsdafasdfsdafasdfasdfasdfasdfasdfsdfasd" name="https://timecontrol.accesscontrol.windows.net/" />
</trustedIssuers>
</issuerNameRegistry>
</service>
</microsoft.identityModel>
</configuration>
To disable Azure ACS you have to at least change section
<httpRuntime requestValidationMode="2.0" />
<authorization>
<deny users="?" />
</authorization>
to
<httpRuntime requestValidationMode="2.0" />
<authorization>
<allow users="*" />
</authorization>
And may be also remove <httpRuntime requestValidationMode="2.0" />
if you need old form auth, uncomment
<!--Commented out by FedUtil-->
<!--<authentication mode="Forms"><forms loginUrl="~/Account/Login.aspx" timeout="2880" /></authentication>-->
I'm trying to add diagnostics to an Azure web role by following the example found here:
https://www.windowsazure.com/en-us/develop/net/common-tasks/diagnostics/
When I add the tracing element under system.webserver, I see an error when running the website. The error can be seen even before a breakpoint in OnStart is hit.
Any ideas?
Here is my web.config file with the problematic section commented out:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
</add>
</listeners>
</trace>
</system.diagnostics>
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet_d368ef657c124d629b2577cb9775791c;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
</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" />
</appSettings>
<system.web>
<customErrors mode="Off"></customErrors>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" timeout="2880" />
</authentication>
<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>
<machineKey decryption="AES" decryptionKey="F7FA540B4DFD82E5BB196B95D15FF81F740A8B17F626BAF1D0889905ACBF0B60" validation="SHA1" validationKey="740A8B17F626BAF1D0889905ACBF0B609712CDA49DE62168764FF0DCE537184F0535D5D9AD66DEDC740A8B17F626BAF1D0889905ACBF0B609712CDA497DC1ABF" />
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true" />
<handlers>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<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" />
</handlers>
<!--<tracing>
<traceFailedRequests>
<add path="*">
<traceAreas>
<add provider="ASP" verbosity="Verbose" />
<add provider="ASPNET" areas="Infrastructure,Module,Page,AppServices" verbosity="Verbose" />
<add provider="ISAPI Extension" verbosity="Verbose" />
<add provider="WWW Server"
areas="Authentication,
Security,
Filter,
StaticFile,
CGI,
Compression,
Cache,
RequestNotifications,
Module"
verbosity="Verbose" />
</traceAreas>
<failureDefinitions statusCodes="400-599" />
</add>
</traceFailedRequests>
</tracing>-->
</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="1.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>
</runtime>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
</configuration>
Here is how I solved the issue:
Suddenly the server started printing verbose info about the 500 error (I don't know why, I don't think I changed anything), and then I discovered that the actual error was:
HTTP Error 500.19:
Cannot add duplicate collection entry of type 'add' with unique key
attribute 'path' set to '*'
The solution to this was to add the following line before the add tag:
<remove path="*"/>
So now the tracing tag looks like this:
<tracing>
<traceFailedRequests>
<remove path="*"/>
<add path="*">
<traceAreas>
<add provider="ASP" verbosity="Verbose" />
<add provider="ASPNET" areas="Infrastructure,Module,Page,AppServices" verbosity="Verbose" />
<add provider="ISAPI Extension" verbosity="Verbose" />
<add provider="WWW Server"
areas="Authentication,
Security,
Filter,
StaticFile,
CGI,
Compression,
Cache,
RequestNotifications,
Module"
verbosity="Verbose" />
</traceAreas>
<failureDefinitions statusCodes="400-599" />
</add>
</traceFailedRequests>
</tracing>
and this seems to work fine.
I noticed that you're referencing Microsoft.WindowsAzure.Diagnostics Version=1.8.0.0 which comes part of the October Azure SDK to get the Azure listener. Do you have the Storage client library 1.7 included in your project? The Azure diagnostics library 1.8 relies on the older storage client library 1.7 (not 2.0 which was released with the sdk)
After doing my bit of research and some looking around and researching I cannot find a definite answer nor can I get the URL rewriting to work on godaddy.
IIS 7. The home page works fine but when I go to myurl.com/controlpanel I get the following error
Could not load type 'Intelligencia.UrlRewriter.RewriterHttpModule'.
I have this file loaded on the Bin folder in the root.
Here is my web config file
<?xml version="1.0"?>
<!--
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\vx.x\Config
-->
<configuration>
<configSections>
<section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"/>
</configSections>
<appSettings>
<add key="sitelevel" value="2"/>
<add key="sign" value="$"/>
<add key="siteurl" value="http://myurl.com/"/>
<add key="fromemail" value=""/>
<add key="mailusername" value=""/>
<add key="dateformat" value="ddmmyy"/>
<add key="mailpassword" value=""/>
<add key="mailserver" value=""/>
</appSettings>
<connectionStrings>
<clear/>
<add name="Icondice" connectionString="Data Source=serveraddress;Initial Catalog=db;Persist Security Info=True;User ID=db;Password=123"/>
</connectionStrings>
<SubSonicService defaultProvider="Icondice">
<providers>
<clear/>
<!--CMS Provider-->
<add name="Icondice" type="SubSonic.SqlDataProvider, SubSonic" connectionStringName="Icondice" spClassName="SPs" generatedNamespace="Icondice.DAL" stripTableText="Icondice.DAL_" fixPluralClassNames="true"/>
</providers>
</SubSonicService>
<system.web>
<pages enableEventValidation="false" enableViewStateMac="false" validateRequest="false">
<tagMapping>
<add tagType="System.Web.UI.WebControls.CompareValidator" mappedTagType="Sample.Web.UI.Compatibility.CompareValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.CustomValidator" mappedTagType="Sample.Web.UI.Compatibility.CustomValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.RangeValidator" mappedTagType="Sample.Web.UI.Compatibility.RangeValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.RegularExpressionValidator" mappedTagType="Sample.Web.UI.Compatibility.RegularExpressionValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.RequiredFieldValidator" mappedTagType="Sample.Web.UI.Compatibility.RequiredFieldValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.ValidationSummary" mappedTagType="Sample.Web.UI.Compatibility.ValidationSummary, Validators, Version=1.0.0.0"/>
</tagMapping>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="cc1"/>
<add namespace="FredCK.FCKeditorV2" assembly="FredCK.FCKeditorV2" tagPrefix="FCKeditorV2"/>
<add tagName="maincat" src="~/controls/maincat.ascx" tagPrefix="uc1"/>
<add tagName="featuredsub" src="~/controls/featuredsub.ascx" tagPrefix="uc2"/>
<add tagName="leftcategory" src="~/controls/leftcategory.ascx" tagPrefix="uc3"/>
<add tagName="webnews" src="~/controls/webnews.ascx" tagPrefix="uc4"/>
<add tagName="searchbox" src="~/controls/searchbox.ascx" tagPrefix="uc5"/>
<add tagName="topMenu" src="~/controls/topMenu.ascx" tagPrefix="uc6"/>
<add tagName="catbrand" src="~/controls/catbrand.ascx" tagPrefix="uc7"/>
<add tagName="leftsubcat" src="~/controls/leftsubcat.ascx" tagPrefix="uc8"/>
<add tagName="cartstatus" src="~/controls/cartstatus.ascx" tagPrefix="uc9"/>
<add tagName="accountlinks" src="~/controls/accountlinks.ascx" tagPrefix="uc10"/>
<add tagName="customertestimonials" src="~/controls/customertestimonials.ascx" tagPrefix="uc11"/>
<add tagName="NewsLetter" src="~/controls/NewsLetter.ascx" tagPrefix="uc12"/>
<add tagName="login" src="~/controls/login.ascx" tagPrefix="uc13"/>
<add tagName="breadcrumbs" src="~/controls/breadcrumbs.ascx" tagPrefix="uc14"/>
<add tagName="footerlist" src="~/controls/footerlist.ascx" tagPrefix="uc15"/>
<add tagName="myaccountlink" src="~/controls/myaccountlink.ascx" tagPrefix="uc16"/>
<add tagName="slider" src="~/controls/slider.ascx" tagPrefix="uc17"/>
<add tagName="moremenu" src="~/controls/moremenu.ascx" tagPrefix="uc18"/>
<add tagName="priceformula" src="~/controlpanel/controls/priceformula.ascx" tagPrefix="uc19"/>
<add tagName="dealerprice" src="~/controlpanel/controls/dealerprice.ascx" tagPrefix="uc20"/>
<add tagName="mymessages" src="~/controls/customermessages.ascx" tagPrefix="uc21"/>
<add tagName="attachment" src="~/controlpanel/controls/attachment.ascx" tagPrefix="uc22"/>
<add tagName="menurightschild" src="~/controlpanel/controls/menurightschild.ascx" tagPrefix="uc23"/>
<add tagName="usermenurights" src="~/controlpanel/controls/usermenurights.ascx" tagPrefix="uc25"/>
</controls>
</pages>
<customErrors mode="Off"/>
<httpHandlers>
<remove path="*.asmx" verb="*"/>
<add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<!--<add path="*.aspx" verb="*" type="UrlRewriter" validate="false"/>-->
</httpHandlers>
<httpModules>
<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter"/>
</httpModules>
<!--
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="false">
<assemblies>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Windows.Forms, Version=2.0.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.
-->
<!--
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>
-->
</system.web>
<system.webServer>
<rewrite>
<rules>
<rule name="Strip Default.aspx Out">
<match url="(.*)default.aspx" ignoreCase="false" />
<action type="Redirect" url="{R:1}" redirectType="Permanent" />
</rule>
<rule name="Canonical Host Name" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^myutl\.com$" />
</conditions>
<action type="Redirect" url="http://www.myurl.com/{R:1}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule"/>
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</modules>
<handlers>
<!--<add name="*.aspx_*" path="*.aspx" verb="*" type="UrlRewriter" preCondition="integratedMode,runtimeVersionv3.5"/>-->
<remove name="WebServiceHandlerFactory-Integrated"/>
<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>
</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>
<rewriter>
<!--Pages-->
<rewrite url="~/store/(.+)-(.+).aspx" to="~/cms.aspx?cid=$2"/>
<rewrite url="~/products/(.+)-(.+).aspx" to="~/product.aspx?prodid=$2"/>
<rewrite url="~/news/(.+)-(.+).aspx" to="~/news.aspx?newsid=$2"/>
</rewriter>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="MerchantAPIServiceEndPoint" 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="Transport">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
<customBinding>
<binding name="WebHttpBinding_MerchantAPIService">
<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
messageVersion="Soap12" writeEncoding="utf-8">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</textMessageEncoding>
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="https://merchantapi.apac.paywithpoli.com/MerchantAPIService.svc"
binding="basicHttpBinding" bindingConfiguration="MerchantAPIServiceEndPoint"
contract="MerchantAPIService" name="MerchantAPIServiceEndPoint" />
</client>
</system.serviceModel>
</configuration>
There is a good chance that there might be a server issue based on the info given. I recommend contacting support at http://x.co/WeHelp and requesting to have that function tested on the server you are using. Hope this helps.