.net site all pages do a 302 redirect with AspxAutoDetectCookieSupport - session-state

First let me say that I did see this article:
How to remove AspxAutoDetectCookieSupport
However it seems like it fixes the url issue, but not the 302 AspxAutoDetectCookieSupport issue.
I've also read just about every other article on the web about this issue.
I could really use some help here.
This is my web.config
<sessionState mode="InProc" cookieless="false" timeout="6600" />
<membership defaultProvider="MySqlMembershipProvider">
<providers>
<clear />
<add connectionStringName="SimpleTickConnection" applicationName="TheaterSales" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="15" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" name="MySqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</membership>
<anonymousIdentification enabled="true" cookieless="AutoDetect" cookieProtection="All" cookieRequireSSL="false" cookieSlidingExpiration="true" />
To replicate the issue:
http://web-sniffer.net/
and use your url
alt text http://img28.imageshack.us/img28/8615/issue.gif

Ok, I researched on: anonymousIdentification
I removed
cookieless="AutoDetect"
And now the object moved error went away

Related

Provider error after migrating from SQL Server Compact 4.0 to SQL Server Express

We decided to migrate from SQL Server Compact to SQL Server Express (possibly LocalDB) as Compact is no longer supported and we believe Express is more feature rich and likely performs better.
I made the changes necessary (although clearly missed something :) ) and the database is recreated as an .mdf file. The problem seems to be when the database is accessed. I get the error I have pasted below. The upshot is that somehow, somewhere I seem to have a reference to a provider with invariant name System.Data.SqlServerCe.4.0 when I have no intention of doing so.
I have done research and found these two relevant posts, which are not fully answered:
MVC app erroring on SqlServerCe.4.0 provider after converting to Sql Express
and
Entity Framework using the wrong connection provider
I have tried deleting the migrations and have modified the app.config file. I have also deleted on references to SQL Server Compact from the project references. What else should I be looking at? I'm tearing my hair out over this one.
What other information can I provide?
Thanks,
Dave
P.S. Another way to ask the question would be pointing out that https://stackoverflow.com/users/183934/erikej commented in the links above:
"Obviously you reference sqlce somewhere, either in .settings or in code based configuration DbConfiguration class... – ErikEJ Sep 13 '14 at 6:09 "
Where are all possible places that Compact could be referenced?
Exception thrown: 'System.Data.DataException' in EntityFramework.dll
Exception thrown: 'System.Data.DataException' in mscorlib.dll
The thread 0x2df0 has exited with code 0 (0x0).
05.01.2017 21:50:50: Fatal [line: 18 StartupErrorViewModel -> .ctor()]: System.Data.DataException: An exception occurred while initializing the database. See the InnerException for details.
System.Data.Entity.Core.MetadataException: Schema specified is not valid. >
Errors:
(0,0) : error 0152: No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlServerCe.4.0'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
at System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Loader.ThrowOnNonWarningErrors()
at System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Loader.LoadItems(IEnumerable1 xmlReaders, IEnumerable1 sourceFilePaths)
at System.Data.Entity.Core.Metadata.Edm.StoreItemCollection.Loader..ctor(IEnumerable1 xmlReaders, IEnumerable1 sourceFilePaths, Boolean throwOnError, IDbDependencyResolver resolver)
at System.DThe thread 0x6d84 has exited with code 0 (0x0).
ata.Entity.Core.Metadata.Edm.StoreItemCollection.Init(IEnumerable1 xmlReaders, IEnumerable1 filePaths, Boolean throwOnError, IDbDependencyResolver resolver, DbProviderManifest& providerManifest, DbProviderFactory& providerFactory, String& providerInvariantName, String& providerManifestToken, Memoizer2& cachedCTypeFunction)
at System.Data.Entity.Core.Metadata.Edm.StoreItemCollection..ctor(IEnumerable1 xmlReaders)
at System.Data.Entity.Utilities.XDocumentExtensions.GetStorageMappingItemCollection(XDocument model, DbProviderInfo& providerInfo)
at System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.Diff(XDocument sourceModel, XDocument targetModel, Lazy1 modificationCommandTreeGenerator, MigrationSqlGenerator migrationSqlGenerator, String sourceModelVersion, String targetModelVersion)
at System.Data.Entity.Internal.InternalContext.ModelMatches(VersionedModel model)
at System.Data.Entity.Internal.ModelCompatibilityChecker.CompatibleWithModel(InternalContext internalContext, ModelHashCalculator modelHashCalculator, Boolean throwIfNoMetadata, DatabaseExistenceState existenceState)
at System.Data.Entity.Internal.InternalContext.CompatibleWithModel(Boolean throwIfNoMetadata, DatabaseExistenceState existenceState)
at System.Data.Entity.CreateDatabaseIfNotExists1.InitializeDatabase(TContext context)
at System.Data.Entity.Internal.InternalContext.<>c__DisplayClassf1.<CreateInitializationAction>b__e()
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
--- End of inner exception stack trace ---
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)
at System.Data.Entity.Internal.RetryAction1.PerformAction(TInput input)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action1 action)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet1.GetEnumerator()
at System.Data.Entity.Infrastructure.DbQuery1.System.Collections.Generic.IEnumerable.GetEnumerator()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
at Med.Vax.DataAccess.Repositories.LocalDbRepository1.GetAll() in C:\MedRepo\vax-box-sw\App\DataAccess\Repositories\LocalDbRepository.cs:line 68
at Med.Vax.App.d__28.MoveNext() in C:\MedRepo\vax-box-sw\App\App\App.xaml.cs:line 198
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task ta'Vax.exe' (CLR v4.0.30319: Vax.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXmlLinq\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXmlLinq.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Vax.exe' (CLR v4.0.30319: Vax.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemCore\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemCore.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
sk)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Med.Vax.App.d__30.MoveNext() in C:\MedRepo\vax-box-sw\App\App\App.xaml.cs:line 503
ADDITIONAL INFO BASED ON COMMENTS
There are two app.config files, and perhaps this is part of the problem. One in the main app part, and one in the data access layer. Notice the code that is commented out with <!-- --> I asssume this is perfectly fine to do as these are just xml files?
Here's the one in the main app:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="TruMed.AccuVax.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<appSettings>
<add key="LoggingVerbosity" value="Debug" />
<add key="StartMaximized" value="True" />
<add key="AllowMultipleInstances" value="False" />
<add key="ScreenSaverTimeoutSeconds" value="60" />
<add key="TranslationFile" value="Translation\TranslationData.xml" />
<add key="SoftwareUpgradeDirectory" value="C:\TruMed\SoftwareUpgrade" />
<add key="FirmwareUpgradeDirectory" value="C:\TruMed\FirmwareUpgrade" />
<add key="PerformDatabaseMaintenance" value="False" />
<add key="AWSRegion" value="us-west-2"/>
<add key="AWSProfilesLocation" value="C:\TruMed\AccuVax\credentials"/>
</appSettings>
<!--
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework">
<parameters>
<parameter value="System.Data.SqlServerCe.4.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact" />
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SqlServerCe.4.0" />
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
</DbProviderFactories>
</system.data>
-->
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<userSettings>
<TruMed.AccuVax.Properties.Settings>
<setting name="RobotZParkingLocation" serializeAs="String">
<value>0</value>
</setting>
</TruMed.AccuVax.Properties.Settings>
</userSettings>
</configuration>
and here is the one from the data access layer:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<!--
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework">
<parameters>
<parameter value="System.Data.SqlServerCe.4.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact" />
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SqlServerCe.4.0" />
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
</DbProviderFactories>
</system.data>
-->
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
Except for the commented out sections, I do not believe I am mentioning SQL Server Compact!
ADDITIONAL INFO IN RESPONSE TO COMMENTS 2
The configuration string used is pulled from a .json file and looks like this:
LocalDbConnection:
Server=(LocalDB)\\MSSQLLocalDB;Integrated Security=true;Initial Catalog=Vax3
Previously I was using:
Data Source=C:\ProgramData\TruMed\AccuVax\AccuVax.sdf;
Clearly there is some concern I'm using the wrong connection string and/or adapter as I'm getting messages about SQL Server Compact. I have searched the code for AccuVax.sdf and have not found any instances. Again, database is created no problem; the problem seems to be accessing it.
We also had the same problem. We tried to migrate from SQL Compact to SQL Express. We chased and removed any reference to SQL Compact in the solution but that was not enough.
Our final move was to clean completely the solution (any visual studio that are not needed to open the solution):
remove obj, debug, release...
remove .vs folder (that's probably the one)
Finally we reopened the solution, tried again and got it work.
Hope it helps.

How do you enable logging for CrmServiceClient in the Xrm Tooling toolkit?

I'm having issues trying to log in to a CRM Online organization through the use of the latest version of the Xrm Tooling nuget package using the connection string constructor from a custom powershell cmdlet.
I'm receiving a rather unhelpful "Unable to Login to Dynamics CRM" error message and am attempting to enable tracing to troubleshoot but have not been able to enable it by modifying the .dll.config file like the below (taken from an XrmToolbox issue on GitHub):
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="Microsoft.Xrm.Tooling.Connector.CrmServiceClient"
switchName="Microsoft.Xrm.Tooling.Connector.CrmServiceClient"
switchType="System.Diagnostics.SourceSwitch">
<listeners>
<add name="console" type="System.Diagnostics.DefaultTraceListener" />
<remove name="Default" />
<add name ="fileListener" />
</listeners>
</source>
<source name="Microsoft.Xrm.Tooling.CrmConnectControl"
switchName="Microsoft.Xrm.Tooling.CrmConnectControl"
switchType="System.Diagnostics.SourceSwitch">
<listeners>
<add name="console" type="System.Diagnostics.DefaultTraceListener" />
<remove name="Default" />
<add name ="fileListener" />
</listeners>
</source>
</sources>
<switches>
<!--
Possible values for switches: Off, Error, Warning, Info, Verbose
Verbose: includes Error, Warning, Info, Trace levels
Info: includes Error, Warning, Info levels
Warning: includes Error, Warning levels
Error: includes Error level
-->
<add name="Microsoft.Xrm.Tooling.Connector.CrmServiceClient" value="Verbose" />
<add name="Microsoft.Xrm.Tooling.CrmConnectControl" value="Verbose" />
<add name="Microsoft.Xrm.Tooling.WebResourceUtility" value="Verbose" />
</switches>
<sharedListeners>
<add name="fileListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="XRMToolingLogs.log" />
<!--<add name="eventLogListener" type="System.Diagnostics.EventLogTraceListener" initializeData="XRMTooling" />-->
</sharedListeners>
</system.diagnostics>
</configuration>
I was able to work around this by configuring the listener programmatically through:
Microsoft.Xrm.Tooling.Connector.TraceControlSettings.TraceLevel = System.Diagnostics.SourceLevels.All;
Microsoft.Xrm.Tooling.Connector.TraceControlSettings.AddTraceListener(new TextWriterTraceListener("log.txt"));
Which pointed me to the actual error which was that the CrmServiceClient was expecting a URL with the organization unique name instead of the URL name.

Issue with configuring web.config to use sql server database

I playing around with the John Papa's HotTowel application. The HotTowel sample uses local codecamper.sdf database and I am trying to configure it to use the database on a sql server 2008 r2. When I run the application, I am getting an error saying "An exception of type 'System.InvalidOperationException' occurred in Breeze.ContextProvider.EF6.dll but was not handled in user code." The error is occurring in the CodeCamperRepository.cs on the line that says "get {return _contextProvider.Metadata()" code. The inner exception says
The connection string 'CodeCamper' in the application's configuration file does not contain the required providerName attribute."
I have the following code in web.config, but I unsure if it is correct:
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="CodeCamper" connectionString="Data Source=testdb\cmstest; Integrated Security=True; MultipleActiveResultSets=True" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameters>
<parameter value="Data Source=testdb\cmstest; Integrated Security=True; MultipleActiveResultSets=True" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<system.webServer>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
</configuration>
Are there any other changes I should look at to make HotTowel connect to Sql Server? what is it that breeze doesn't like about the configuration? Appreciate any insight.
thanks Community
np
Just like the inner exception says: you need the providerName attribute. So change your ConnectionStrings section to:
<connectionStrings>
<add name="CodeCamper" connectionString="Data Source=testdb\cmstest; Integrated Security=True; MultipleActiveResultSets=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
Just checking, but do you have the CodeCamper connection reference in your DbContext contstructor?
public CCDbContext()
: base("CodeCamper"){ }

asp2 roles and membership settings in web.config

How can i set up web.config file to support user membership with roles for my mvc page with only database file as i do not have access to sql server at the moment.
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn"
protection="All"
timeout="30"
name="AppNameCookie"
path="~/Account/LogOn"
requireSSL="false"
slidingExpiration="true"
defaultUrl="default.aspx"
cookieless="UseCookies"
enableCrossAppRedirects="false" />
</authentication>
<membership defaultProvider="MyMembershipProvider">
<providers>
<clear/>
<add name="MyMembershipProvider" type="NudaJeFuc.WebUI.Classes.MyMembershipProvider"
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>
<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.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="NudaJeFuc.WebUI.HtmlHelpers"/>
</namespaces>
</pages>
Your web.config looks fine, but you need to set up a connectionString (in your case named ApplicationServices) to point to Sql server that will store membership database.
You can create membership database using a wizard, just run aspnet_regsql from VS cmd. You can read more on MSDN.

ELMAH / Server 2008 / IIS 7.5 / MVC 2 : 500 - Internal server error

I've been trying to resolve a 404 error received when trying to access ELMAH.axd. The ELMAH email functionality worked, but I could not navigate to the axd. Now, I'm getting 500.22 - Internal server error. Can someone spot the error in my code or suggest some recourse short of disabling ELMAH?
<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="errorTweet" requirePermission="false" type="Elmah.ErrorTweetSectionHandler, Elmah"/>
</sectionGroup>
<system.web>
<authentication mode="Windows" />
<authorization>
<allow roles="ViewOnly,Admins" />
<deny users="*" />
</authorization>
<elmah>
<security allowRemoteAccess="1" />
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="ElmahConnectionString" />
<!-- email configured here -->
</elmah>
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
<add name="ErrorTweet" type="Elmah.ErrorTweetModule, Elmah"/>
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/>
</httpModules>
<httpHandlers>
<add verb="GET,HEAD" path="asset.axd" validate="false" type="Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc" />
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</httpHandlers>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" >
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
</modules>
<location path="elmah.axd">
<system.web>
<authorization>
<deny users="*" />
</authorization>
</system.web>
</location>
And in Global.asax:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
I'm using a database to record ELMAH data.
What am I missing? I've read so many posts and it seems that there is no one right answer, I suppose given the several ways applications and servers can be configured.
The error you are seeing definitely looks like a configuration issue.
HTTP 500.22 - "An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode."
I found this link that provides some details on breaking changes in II7. More details specific to the web.config can be found here.
Do you have the ELMAH handler configured in the system.webSever section of your web.config? If not, I believe adding it should resolve your issue:
<handlers>
<add name="Elmah" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</handlers>
All I can see is that:
You are trying to make ELMAH logging errors into a database, but the connection string ElmahConnectionString is not defined anywhere. BTW, you should start trying to use logPath="~/App_Data" instead; if all runs well, then implement the database connection.
deny users = "*" means deny everyone; deny users = "?" means deny unauthenticated users. I guess what you want is the latter.
What mode is your application pool running in (classic or integrated)? I had this problem and found that Elmah started working after I change my app pool to integrated mode.