ALREADY CONTAINS A DEFINITION FOR ...

Hello,
we are testing SyntaxEditor for our use. Everything works well for our needs. The problem occurs the second time you open the form editor within the process. The errors in the entire document will be highlighted and the "Already contains a definition for" information will be highlighted.
Fragment code for use:
txtCode is SyntaxCode in designer
var csParser = new Alternet.Syntax.Parsers.Roslyn.CsParser();
csParser.Repository.RegisterAssemblies(new string[] { "DevExpress.Xpo.v19.1", "Npgsql", "System.Data" , "System.Data.Entity" });
csParser.ParseInterval = 50;
txtCode.Lexer = csParser;
txtCode.Text = "my cs code";
It is a newly created form, SyntaxEdit and CsParser instance.
Thank you
Hi John,
I had a similar problem for VBParser. Here the reason was that the parameterless constructor for VBParser uses a static "VbSolution.DefaultSolution". So, if you add the reference once, it will be added to this DefaultSolution, and the next call will add it a second time.
Solution: call "new CsParser (new CsSolution())"

Hope this helps
Wolfgang
Thank you,

it work.

John
Hi John,
This problem might appear if you have the same code added twice to the solution (which would be the case if you do not set syntaxEdit.Source.FileName)
Even in this case if you dispose first copy of editor, this should clean up that document. In case you set FileName, this problem should go away.
regards,
Andrew
Hi Andrew,
i want to display a XML-file with XML-Declaration in Syntax Editor using the XML-Parser. How can i configure it in the XML-Parser?

Regards,
Hien