Note that there are some explanatory texts on larger screens.

plurals
  1. PO.NET: Strange Assembly not found error
    text
    copied!<p>I am stumped. I have a solution with a couple projects. Among them a little side project that doesn't do very much more than doing some XML reading / writing. It is a C# project and I am using XDocument / XElement from the System.Xml.Linq namespace. The project is targetting .NET 3.5 framework.</p> <p>Now, when I try to run it, I get this strange exception:</p> <blockquote> <p>"$exception {System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> System.IO.FileNotFoundException: Die Datei oder Assembly System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden."</p> </blockquote> <p>I apologize that the message is in german; I'll give a translation of the core part: System.IO.FileNotFoundException: File or Assembly System.Xml.Linq, [...] not found. System cannot find the file.</p> <p>The project references the System.Xml.Linq.dll residing in "%programfiles%\Reference Assemblies\Microsoft\Framework\v3.5". It exists and is registered in the GAC with corresponding version and public key token. When debugging, the exception occurs even before the tracer steps into the method in question, but after the code is compiled and I have run the project that calls the failing method.</p> <p>The code is this:</p> <pre><code>public static SimpleTree&lt;SankeyItem&gt; XML2Tree(String xml) { XDocument document = XDocument.Load(xml); SimpleTree&lt;SankeyItem&gt; tree = new SimpleTree&lt;SankeyItem&gt;(); XElement element = document.Root; if (element.Name == "Node") { DoSomethingUseful(element) } else { throw new TreeParseException("Useful message here"); } return tree; } </code></pre> <p>If I comment out all the XSomething code, it works. Please, I have no idea what could cause this issue. :( For completeness sake: The string "xml" is neither null not empty (the "real" code checks that).</p> <p>Thank you in advance!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload