So, let me explain my trouble.
I get a project which was develop by another guy, and he leaved the firm. Now i have to update the program but something going wrong when i import the solution.
Let see the code:
ListeDeTypeDePoste = (from e in xml.Descendants("profil")
select new TypeDePoste()
{
Nom = e.Element("name").Value,
Chaines = (from c in e.Elements("Chaine")
select new Chaine()
{
Code = c.Element("Code")?.Value,
Type = c.Element("Type")?.Value,
Nom = c.Element("Nom")?.Value,
OU = c.Element("OU")?.Value
}).ToList()
}).ToList<TypeDePoste>();
The trouble is on the .?Value
for each properties in a Chaine Class, when i debug i can even debug the solution and if i remove them i got a NullReferenceException. With this code the previous realese .exe worked like a charm