내가 윈폼의 폼로드 이벤트에 다음 코드를 실행하려고구성 파일 8.1
MessageBox.Show(IPAddress.Parse("127.0.0.1").ToString());
그 작업 및 Windows 8.1 및 Windows Server를 제외한 모든 OS에서 127.0.0.1 터지는 2012 년
윈도우 8.1에서의 내 app.config 파일의 내용을 나에게 다음과 같은 오류
Error - The configuration section cannot contain a CDATA or text element. (C:\Program Files\eRS\Test.exe.Config line 3). Trace - at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult)
at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey, Boolean getLkg, Boolean checkPermission)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.ConfigurationManager.get_AppSettings()
at System.Diagnostics.PerformanceCounterLib.GetLocalizedPerfCounterMode()
at System.Diagnostics.PerformanceCounterLib.IsLocalizedMode()
at System.Diagnostics.PerformanceCounterLib.IsCustomCategory(String machine, String category)
at System.Diagnostics.PerformanceCounter.Initialize()
at System.Diagnostics.PerformanceCounter.set_RawValue(Int64 value)
at System.Net.NetworkingPerfCounters.Initialize()
at System.Net.Configuration.SettingsSectionInternal..ctor(SettingsSection section)
at System.Net.Configuration.SettingsSectionInternal.get_Section()
at System.Net.Sockets.Socket.InitializeSockets()
at System.Net.IPAddress.InternalParse(String ipString, Boolean tryParse)
at System.Net.IPAddress.Parse(String ipString)
at Test.Form1.Form1_Load(Object sender, EventArgs e)
입니다 제공
<?xml version="1.0" encoding="utf-8"?> <configuration>appSettings>wwgp89LZ6RQNuYqA4QW49%2b54BdPvtS7WTpSIbQD39tBU8g6XgzuTvCbTL%2feaONiaI6S9c0rNsbbJRqjiW4pfjcndQF8Ol%2fxBWbT1ae0HhxAfoq1ZeF9FTq9KD%2bu1fi1QgFqPhbnM3VJMBGMx4QIBRTHQcQpcEsi9xjkSQ1AT4dt5qWAbfonvvHc1HqCtkoAyB8I9PG7HK6l844sCWVqRrUh8%2biICB0K2i1lJkwmlwhPoEqvW%2bHaXuSit1rCYasIn%2balIQ8wVyW8H5y8aNNzWWfEsYJSID%2bI2b379DiyENBLnacTAQ%3d%3d</appSettings>
</configuration>
그것의 이미. 다른 운영 체제에서 잘 작동합니다. appSettings는 실제로 암호화되고 프로그래밍 방식으로 해독하면 키 값 쌍이 생깁니다. –
Gentleman
설정 파일의 3 행에 무엇이 있습니까? 나는 그 긴 문자열을 추측하고있다. 이 오류는 app.config 파일의 형식이 올바르지 않다는 것을 의미합니다. 제대로 포맷하지 않으면 작동하지 않습니다. –
그러면 다른 Windows OS에서 어떻게 작동합니까? 이것은 Windows 8.1에서만 작동하지 않습니다. – Gentleman