Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom MSBuild for .NET Core task cannot reference System.Xml.XPath.XmlDocument #2484

Closed
jkoritzinsky opened this issue Aug 30, 2017 · 2 comments
Labels

Comments

@jkoritzinsky
Copy link
Member

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.

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 either dotnet build test.proj or dotnet msbuild test.proj in the bin directories. The MSBuild test run will crash with the above exception.

@jkoritzinsky
Copy link
Member Author

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?

@rainersigwald
Copy link
Member

This should be resolved now by #4916.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants