[英]Configuration error in ASP.NET application when deploying to new server
我有一个已经在Windows Server 2003上运行了几年的现有ASP.NET应用程序。我们现在正在迁移到Server 2008 R2,并抓住机会加强安全性,例如拥有应用程序池在专用服务帐户下运行而不是ApplicationPoolIdentity。
我得到的问题是,当我在浏览器中打开应用程序时,我收到以下错误:
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">
现在看一下有问题的web.config,没有'\\'字符浮动造成麻烦。 如果我移动配置文件的各个部分,例如将各种<location>
标记放在<fiftyOne>
标记之前,则会出现相同的错误,指的是完全相同的行号。
我已经尝试将配置文件复制回我的本地PC并运行它,它在那里运行良好,这在新服务器上建议环境,但如果是这种情况,它肯定是最错误的错误消息的竞争者在.NET Framework中。
有没有其他人经历过这样的事情?
别担心,我弄清楚问题是什么(通过取出每个配置元素并逐个添加它们); appSettings
部分是从外部文件加载的, 该文件确实有一个格式错误的元素缺少“on an attribute”。
ASP.NET说这个错误是使用web.config
而不是我的外部appSettings.config
,这仍然是非常烦人的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.