Visual Studio 2015应用程序在开发服务器上运行,而不是在测试服务器上运行

时间:2017-01-25 00:30:41

标签: c# visual-studio-2015

我有一个独立的VS2015应用程序通过批处理作业运行。

xxx.bat作业调用生成输出的xxx.exe。

我已在我的本地计算机和开发服务器上测试了完整的解决方案,该服务器运行完全正常。但是,部署到测试服务器的相同代码崩溃说 RptBat.Console在 System.Configuration中' CLR203r' 错误时停止工作。 /强>

应用程序不会输入任何日志信息供我进行故障排除。 我试图更新xxx.cmd.exe.config文件,但它没有帮助。

请指教!

堆栈跟踪对于appsettings文件非常重要,但文件似乎一切正常。

C:\rptbat>call C:\rptbat\rptbat.cmd.exe -v P
log4net:ERROR DefaultRepositorySelector: Exception while reading ConfigurationSe
ttings. Check your .config file is well formed XML.
System.Configuration.ConfigurationErrorsException: Configuration system failed t
o initialize ---> System.Configuration.ConfigurationErrorsException: The 'config
uration' start tag on line 2 does not match the end tag of 'appSettings'. Line 2
6, position 5. (C:\rptbat\rptbat.Cmd.exe.config line 26) ---> System.Xml.XmlException: The 'configuration' start
tag on line 2 does not match the end tag of 'appSettings'. Line 26, position 5.

at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.ThrowTagMismatch(NodeData startTag)
at System.Xml.XmlTextReaderImpl.ParseEndElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at System.Xml.XmlTextReaderImpl.Skip()
at System.Xml.XmlTextReader.Skip()
at System.Configuration.XmlUtil.StrictSkipToNextElement(ExceptionAction actio
n)
at System.Configuration.BaseConfigurationRecord.ScanSectionsRecursive(XmlUtil
xmlUtil, String parentConfigKey, Boolean inLocation, String locationSubPath, Ov
errideModeSetting overrideMode, Boolean skipInChildApps)
at System.Configuration.BaseConfigurationRecord.ScanSections(XmlUtil xmlUtil)

at System.Configuration.BaseConfigurationRecord.InitConfigFromFile()
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignor
eLocal)
at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(Configurat
ionSchemaErrors schemaErrors)
at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()
at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey
)
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.PrivilegedConfigurationManager.GetSection(String sect
ionName)
at System.Diagnostics.DiagnosticsConfiguration.GetConfigSection()
at System.Diagnostics.DiagnosticsConfiguration.Initialize()
at System.Diagnostics.DiagnosticsConfiguration.get_IndentSize()
at System.Diagnostics.TraceInternal.InitializeSettings()
at System.Diagnostics.TraceInternal.WriteLine(String message)
at System.Diagnostics.Trace.WriteLine(String message)
at log4net.Util.LogLog.EmitErrorLine(String message)
log4net:ERROR DefaultRepositorySelector: Exception while reading ConfigurationSe
ttings. Check your .config file is well formed XML.
System.Configuration.ConfigurationErrorsException: Configuration system failed t
o initialize ---> System.Configuration.ConfigurationErrorsException: The 'config
uration' start tag on line 2 does not match the end tag of 'appSettings'. Line 2
6, position 5. (C:\rptbat\ReportBatcher
.Cmd.exe.config line 26) ---> System.Xml.XmlException: The 'configuration' start
tag on line 2 does not match the end tag of 'appSettings'. Line 26, position 5.

at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.ThrowTagMismatch(NodeData startTag)
at System.Xml.XmlTextReaderImpl.ParseEndElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at System.Xml.XmlTextReaderImpl.Skip()
at System.Xml.XmlTextReader.Skip()
at System.Configuration.XmlUtil.StrictSkipToNextElement(ExceptionAction actio
n)
at System.Configuration.BaseConfigurationRecord.ScanSectionsRecursive(XmlUtil
xmlUtil, String parentConfigKey, Boolean inLocation, String locationSubPath, Ov
errideModeSetting overrideMode, Boolean skipInChildApps)
at System.Configuration.BaseConfigurationRecord.ScanSections(XmlUtil xmlUtil)

at System.Configuration.BaseConfigurationRecord.InitConfigFromFile()
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignor
eLocal)
at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(Configurat
ionSchemaErrors schemaErrors)
at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()
at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey
)
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.ConfigurationManager.get_AppSettings()
at log4net.Util.SystemInfo.GetAppSetting(String key)
log4net:ERROR DefaultRepositorySelector: Exception while reading ConfigurationSe
ttings. Check your .config file is well formed XML.
System.Configuration.ConfigurationErrorsException: Configuration system failed t
o initialize ---> System.Configuration.ConfigurationErrorsException: The 'config
uration' start tag on line 2 does not match the end tag of 'appSettings'. Line 2
6, position 5. (C:\rptbat\ReportBatcher
.Cmd.exe.config line 26) ---> System.Xml.XmlException: The 'configuration' start
tag on line 2 does not match the end tag of 'appSettings'. Line 26, position 5.

at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.ThrowTagMismatch(NodeData startTag)
at System.Xml.XmlTextReaderImpl.ParseEndElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at System.Xml.XmlTextReaderImpl.Skip()
at System.Xml.XmlTextReader.Skip()
at System.Configuration.XmlUtil.StrictSkipToNextElement(ExceptionAction actio
n)
at System.Configuration.BaseConfigurationRecord.ScanSectionsRecursive(XmlUtil
xmlUtil, String parentConfigKey, Boolean inLocation, String locationSubPath, Ov
errideModeSetting overrideMode, Boolean skipInChildApps)
at System.Configuration.BaseConfigurationRecord.ScanSections(XmlUtil xmlUtil)

at System.Configuration.BaseConfigurationRecord.InitConfigFromFile()
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignor
eLocal)
at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(Configurat
ionSchemaErrors schemaErrors)
at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()
at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey
)
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.ConfigurationManager.get_AppSettings()
at log4net.Util.SystemInfo.GetAppSetting(String key)
log4net:ERROR DefaultRepositorySelector: Exception while reading ConfigurationSe
ttings. Check your .config file is well formed XML.
System.Configuration.ConfigurationErrorsException: Configuration system failed t
o initialize ---> System.Configuration.ConfigurationErrorsException: The 'config
uration' start tag on line 2 does not match the end tag of 'appSettings'. Line 2
6, position 5. (C:\rptbat\ReportBatcher
.Cmd.exe.config line 26) ---> System.Xml.XmlException: The 'configuration' start
tag on line 2 does not match the end tag of 'appSettings'. Line 26, position 5.

at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.ThrowTagMismatch(NodeData startTag)
at System.Xml.XmlTextReaderImpl.ParseEndElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at System.Xml.XmlTextReaderImpl.Skip()
at System.Xml.XmlTextReader.Skip()
at System.Configuration.XmlUtil.StrictSkipToNextElement(ExceptionAction actio
n)
at System.Configuration.BaseConfigurationRecord.ScanSectionsRecursive(XmlUtil
xmlUtil, String parentConfigKey, Boolean inLocation, String locationSubPath, Ov
errideModeSetting overrideMode, Boolean skipInChildApps)
at System.Configuration.BaseConfigurationRecord.ScanSections(XmlUtil xmlUtil)

at System.Configuration.BaseConfigurationRecord.InitConfigFromFile()
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignor
eLocal)
at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(Configurat
ionSchemaErrors schemaErrors)
at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()
at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey
)
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.ConfigurationManager.get_AppSettings()
at log4net.Util.SystemInfo.GetAppSetting(String key)
log4net:ERROR DefaultRepositorySelector: Exception while reading ConfigurationSe
ttings. Check your .config file is well formed XML.
System.Configuration.ConfigurationErrorsException: Configuration system failed t
o initialize ---> System.Configuration.ConfigurationErrorsException: The 'config
uration' start tag on line 2 does not match the end tag of 'appSettings'. Line 2
6, position 5. (C:\rptbat\ReportBatcher
.Cmd.exe.config line 26) ---> System.Xml.XmlException: The 'configuration' start
tag on line 2 does not match the end tag of 'appSettings'. Line 26, position 5.

at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.ThrowTagMismatch(NodeData startTag)
at System.Xml.XmlTextReaderImpl.ParseEndElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at System.Xml.XmlTextReaderImpl.Skip()
at System.Xml.XmlTextReader.Skip()
at System.Configuration.XmlUtil.StrictSkipToNextElement(ExceptionAction actio
n)
at System.Configuration.BaseConfigurationRecord.ScanSectionsRecursive(XmlUtil
xmlUtil, String parentConfigKey, Boolean inLocation, String locationSubPath, Ov
errideModeSetting overrideMode, Boolean skipInChildApps)
at System.Configuration.BaseConfigurationRecord.ScanSections(XmlUtil xmlUtil)

at System.Configuration.BaseConfigurationRecord.InitConfigFromFile()
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignor
eLocal)
at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(Configurat
ionSchemaErrors schemaErrors)
at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()
at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey
)
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.ConfigurationManager.get_AppSettings()
at log4net.Util.SystemInfo.GetAppSetting(String key)
log4net:ERROR XmlConfigurator: Error while loading XML configuration
System.Xml.XmlException: The 'configuration' start tag on line 2 does not match
the end tag of 'appSettings'. Line 26, position 5.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.ThrowTagMismatch(NodeData startTag)
at System.Xml.XmlTextReaderImpl.ParseEndElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean prese
rveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at log4net.Config.XmlConfigurator.Configure(ILoggerRepository repository, Str
eam configStream)
log4net:ERROR DefaultRepositorySelector: Exception while reading ConfigurationSe
ttings. Check your .config file is well formed XML.
System.Configuration.ConfigurationErrorsException: Configuration system failed t
o initialize ---> System.Configuration.ConfigurationErrorsException: The 'config
uration' start tag on line 2 does not match the end tag of 'appSettings'. Line 2
6, position 5. (C:\rptbat\ReportBatcher
.Cmd.exe.config line 26) ---> System.Xml.XmlException: The 'configuration' start
tag on line 2 does not match the end tag of 'appSettings'. Line 26, position 5.

at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.ThrowTagMismatch(NodeData startTag)
at System.Xml.XmlTextReaderImpl.ParseEndElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at System.Xml.XmlTextReaderImpl.Skip()
at System.Xml.XmlTextReader.Skip()
at System.Configuration.XmlUtil.StrictSkipToNextElement(ExceptionAction actio
n)
at System.Configuration.BaseConfigurationRecord.ScanSectionsRecursive(XmlUtil
xmlUtil, String parentConfigKey, Boolean inLocation, String locationSubPath, Ov
errideModeSetting overrideMode, Boolean skipInChildApps)
at System.Configuration.BaseConfigurationRecord.ScanSections(XmlUtil xmlUtil)

at System.Configuration.BaseConfigurationRecord.InitConfigFromFile()
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignor
eLocal)
at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(Configurat
ionSchemaErrors schemaErrors)
at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()
at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey
)
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.ConfigurationManager.get_AppSettings()
at log4net.Util.SystemInfo.GetAppSetting(String key)

1 个答案:

答案 0 :(得分:0)

我想我发现了问题所在 - appsettings文件中有一个数据库连接字符串,其中包含所有凭据和源信息。 应用程序无法读取凭证标记中声明的所有特殊字符。我在Dev服务器中没有这个问题,因为凭据不足以作为测试服务器。 感谢您的支持!