You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a custom MSBuild task uses System.Xml.XPath.XmlDocument.dll, MSBuild will fail to load it correctly and will throw a FileNotFoundException while trying to load it.
It builds both an executable and a dll with a task. You can run the executable via the dotnet CLI and it will not crash. If you want to repro the issue with MSBuild, use either dotnet build test.proj or dotnet msbuild test.proj in the bin directories. The MSBuild test run will crash with the above exception.
The text was updated successfully, but these errors were encountered:
After some investigation, I've found the underlying issue:
MSBuild uses System.Xml.XPath.XmlDocument Version 4.0.1. My packages use version 4.3.0. Since the assembly version of version 4.3.0 is greater than the assembly version used by MSBuild, MSBuild fails to load the assembly, and subsequently crashes. I'm trying to reference the lower version, but I'm getting downgrade errors because a dependency I have uses it, so this fix is extremely fragile and I'm not even sure if it will work.
Any ideas on how to fix this so either there are better error messages or newer versions of the assembly can be loaded in?
jkoritzinsky
added a commit
to SharpGenTools/SharpGenTools
that referenced
this issue
Sep 4, 2017
If a custom MSBuild task uses
System.Xml.XPath.XmlDocument.dll
, MSBuild will fail to load it correctly and will throw aFileNotFoundException
while trying to load it.I have attached an example project: XPathBugRepro.zip
It builds both an executable and a dll with a task. You can run the executable via the
dotnet
CLI and it will not crash. If you want to repro the issue with MSBuild, use eitherdotnet build test.proj
ordotnet msbuild test.proj
in the bin directories. The MSBuild test run will crash with the above exception.The text was updated successfully, but these errors were encountered: