Hi all,
I'm a .NET beginner and I've got a problem on a program where I try to do an
XML serialization.
I get the following error :
"An unmanaged exception of type 'System.IO.File NotFoundExcepti on' occured in
mscorlib.dll
Additonal information : the file or asssembly named n9gu4-bo.dll or one of
its dependencies cannot be found"
Here is the code :
(I've uploaded the complete project at this url
http://netorld.free.fr/Interface2.zip)
public class Form1 : System.Windows. Forms.Form
{
....
....
public Form1()
{
InitializeCompo nent();
try
{
TextReader reader = new StreamReader("c onfig.xml");
XmlSerializer serializer = new XmlSerializer(t ypeof(Coef)); //the error
happens at this line
Coef lesCoefs = (Coef)serialize r.Deserialize(r eader);
reader.Close();
}
catch(XmlExcept ion xe)
{
MessageBox.Show (xe.Message, "XML Parse Error",
MessageBoxButto ns.OK, MessageBoxIcon. Error);
}
catch(InvalidOp erationExceptio n ioe)
{
MessageBox.Show (ioe.InnerExcep tion.Message, "XML Serialization Error",
MessageBoxButto ns.OK, MessageBoxIcon. Error);
}
}
}//End of class Form1
[System.Xml.Seri alization.XmlTy peAttribute(Nam espace="http://Interface2/Coef
")]
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="http://Interface2/Coef
", IsNullable=fals e)]
public class Coef
{
/// <remarks/>
[System.Xml.Seri alization.XmlAr rayAttribute("e preuve")]
[System.Xml.Seri alization.XmlAr rayItemAttribut e("jour",
typeof(CoefEpre uveJourHeure[]), IsNullable=fals e)]
[System.Xml.Seri alization.XmlAr rayItemAttribut e("heure",
typeof(CoefEpre uveJourHeure), NestingLevel=1)]
public CoefEpreuveJour Heure[][][] Items;
}
/// <remarks/>
[System.Xml.Seri alization.XmlTy peAttribute(Nam espace="http://Interface2/Coef
")]
public class CoefEpreuveJour Heure
{
/// <remarks/>
[System.Xml.Seri alization.XmlTe xtAttribute()]
public string Value;
}
Le xml file is structured like that :
<?xml version="1.0" encoding="utf-8" ?>
<Coef xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xmlns="http://Interface2/Coef">
<epreuve>
<jour>
<heure>0</heure>
...
</jour>
....
</epreuve>
....
</Coef>
Thanks for your reading and maybe your answer,
Alain