Reputation: 4079
I have an existing ASP.NET application that has been running for several years on Windows Server 2003. We are now in the midst of migrating to Server 2008 R2, and taking the opportunity to tighten up security along the way, such as having the application pool run under a dedicated service account rather than ApplicationPoolIdentity.
The problem that I am getting is that when I open the application in a browser, I get the following error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: '\' is an unexpected token. The expected token is '"' or '''. Line 37, position 41.
Source Error:
Line 35: <log logFile="~/App_Data/Log.txt" logLevel="Warn"/>
Line 36: <detection binaryFilePath="~/App_Data/51Degrees.mobi-Lite-2013.07.02.dat"/>
Line 37: </fiftyOne>
Line 38: <!-- define all the permissions for the web site -->
Line 39: <enterpriseLibrary.ConfigurationSource selectedSource="File Configuration Source">
Now looking at the offending web.config, there is no '\' character floating around causing trouble. If I move the various sections of the config file around, such as putting the various <location>
tags before the <fiftyOne>
tag, then the same error comes up referring to exactly the same line number.
I have tried copying the configuration file back to my local PC and running it, and it runs fine there, which rather suggests something environmental on the new server, but if that's the case, it must surely be a contender for the most erroneous error message in the .NET Framework.
Has anyone else experienced something like this?
Upvotes: 1
Views: 1376
Reputation: 4079
Don't worry, I figured out what the problem was (by taking out every configuration element and adding them back in one-by-one); the appSettings
section is loaded from an external file, and that file did indeed have a malformed element missing an " on an attribute.
It's still very annoying that ASP.NET was saying that the error was with web.config
, and not with my external appSettings.config
.
Upvotes: 3