C# 3.0 读取自定义配置文件(app.config)时出错
我正在winform应用程序中进行自定义配置。 它将代表一个国家/地区对应列表 首先是CountryList类 GetCountryCurrency方法在CountryCurrency类中定义如下C# 3.0 读取自定义配置文件(app.config)时出错,c#-3.0,C# 3.0,我正在winform应用程序中进行自定义配置。 它将代表一个国家/地区对应列表 首先是CountryList类 GetCountryCurrency方法在CountryCurrency类中定义如下 namespace UtilityMethods { public static class CountryCurrency { public static Hashtable GetCountryCurrency() { Has
namespace UtilityMethods
{
public static class CountryCurrency
{
public static Hashtable GetCountryCurrency()
{
Hashtable ht = new Hashtable();
ht.Add("India", "Rupees");
ht.Add("USA", "Dollar");
return ht;
}
}
}
app.config文件如下所示
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name ="CountryList1" type ="UtilityMethods.CountryList,CountryList,Version=2.0.0.0,
Culture=neutral"/>
</configSections>
<appSettings />
</configuration>
在运行应用程序并单击按钮时,我得到了这个错误
无法从程序集“System.Configuration,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”加载类型“UtilityMethods.CountryList”
请帮助dotnetframework:3.5语言:C我找到了。而不是使用
<section name ="CountryList1" type ="UtilityMethods.CountryList,CountryList,Version=2.0.0.0, Culture=neutral"/>
会的
<section name ="CountryList1" type ="UtilityMethods.CountryList,UtilityMethods"/>
i、 名称空间。类名,名称空间
<section name ="CountryList1" type ="UtilityMethods.CountryList,CountryList,Version=2.0.0.0, Culture=neutral"/>
<section name ="CountryList1" type ="UtilityMethods.CountryList,UtilityMethods"/>