J'écris petite application WM 6.1 qui lire et écrire au format XML, mais je reçois l'exception suivante:Windows Mobile 6 System.PlatformNotSupportedException
System.PlatformNotSupportedException was unhandled
Message="PlatformNotSupportedException"
StackTrace:
at System.Globalization.CompareInfo..ctor(Int32 culture)
at System.Globalization.CompareInfo.GetCompareInfo(Int32 culture)
at System.Globalization.CultureInfo.get_CompareInfo()
at System.CultureAwareComparer..ctor(CultureInfo culture, Boolean ignoreCase)
at System.StringComparer.Create(CultureInfo culture, Boolean ignoreCase)
at System.Data.DataTable.GetSpecialHashCode(String name)
at System.Data.DataColumnCollection.RegisterColumnName(String name, DataColumn column, DataTable table)
at System.Data.DataColumnCollection.BaseAdd(DataColumn column)
at System.Data.DataColumnCollection.AddAt(Int32 index, DataColumn column)
at System.Data.DataColumnCollection.Add(DataColumn column)
at System.Data.DataColumnCollection.Add(String columnName, Type type)
at MyApp.Settings.CreateDT(String Setting, String Key, String Value)
at MyApp.Program.Main()
ici est la méthode CreatDT Body:
public static DataTable CreateDT(string Setting, string Key, string Value)
{
DataTable dt;
dt = new DataTable(Setting);
dt.Columns.Add("Key", Type.GetType("System.String")); //<-- error here
dt.Columns.Add("Value", Type.GetType("System.String"));
AddRow(ref dt, Key, Value);
return dt;
}
tout organisme Aidez-moi? Si c'est PlatformNotSupportedException, alors le problème dépend d'une fonctionnalité qui n'existe pas dans votre système.
essayez de remplacer 'Type.GetType (" System.String ")' par 'typeof (string)' (je n'ai aucun moyen de tester votre code, je devine juste). – Alex
'typeof (string)' ne fonctionne pas aussi – someone
@PawelZ cette option a déjà été cochée – someone