在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
公司的项目,由于老项目里面使用的是.net framework 2.0环境,而我们开发使用的却是VS2008,所以在创建新的应用的时候,把环境设置为.net frameword2.0。 这是一个客户端界面程序,应用到web服务。 但在运行的时候出现以下错误:
)
at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal) at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors) at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors() at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey) --- End of inner exception stack trace --- at System.Configuration.ConfigurationManager.GetSection(String sectionName) at System.Xml.Serialization.XmlSerializerCompilerParameters.Create(String location) at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence) at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type) at System.Web.Services.Protocols.SoapClientType..ctor(Type type) at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor() at ***.CMIService.CMIClientService..ctor() in D:\CMI\TMSEXE\Web References\CMIService\Reference.cs:line 97 at ***.MainForm.Login() in D:\CMI\TMSEXE\form\MainForm.cs:line 67
上网找了下,只要把配置文件中的一段注释掉就行了,见下面代码 配置文件如下: <configSections> <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > <section name="***.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </sectionGroup> </configSections> <!--这一段要注释掉 <system.serviceModel> <bindings /> <client /> </system.serviceModel> --> <applicationSettings> <***.Properties.Settings> <setting name="****" serializeAs="String"> <value>http://www.****.com/***Service.asmx</value> </setting> </***.Properties.Settings> </applicationSettings> </configuration>
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论