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

XmlPoke task not available in .NET Core #1731

Closed
natemcmaster opened this issue Feb 21, 2017 · 5 comments
Closed

XmlPoke task not available in .NET Core #1731

natemcmaster opened this issue Feb 21, 2017 · 5 comments
Labels

Comments

@natemcmaster
Copy link
Contributor

@natemcmaster natemcmaster commented Feb 21, 2017

Repro:

<Project>
   <Target Name="Build">
      <XmlPoke />
   </Target>
</Project>

dotnet msbuild /t:Build

Error

poke.proj(3,7): error MSB4062: The "Microsoft.Build.Tasks.XmlPoke" task could not be loaded from the assembly Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

Expected
Same behavior as MSBuild.exe (full framework)

Details
dotnet.exe version: 1.0.0-rc4-004842
MSBuild version: 15.1.548.43366

cc @rainersigwald @jeffkl

@jeffkl
Copy link
Contributor

@jeffkl jeffkl commented Feb 21, 2017

They are currently not compiled in: https://github.com/Microsoft/msbuild/blob/xplat/src/Tasks/Microsoft.Build.Tasks.csproj#L699

I wasn't around when the conversion was done so I'm not sure why they were left out. I'm assuming they use APIs that aren't available in .NETStandard1.x

@rainersigwald
Copy link
Contributor

@rainersigwald rainersigwald commented Feb 21, 2017

We should bring them back though. We can count this as a vote for pushing this one earlier in the list.

Could have been missing APIs, could have been "not used in our selfhost or the corefx repo and thus we never noticed it wasn't there". We should make sure anything missing in vNext is missing for a good reason.

@natemcmaster
Copy link
Contributor Author

@natemcmaster natemcmaster commented Feb 21, 2017

I took a quick look. The API is available in .NET Standard 1.3, but you would probably have to add references to the System.Xml.XPath and System.Xml.XPath.XmlDocument packages.

jeffkl added a commit to jeffkl/msbuild that referenced this issue Feb 21, 2017
…or whatever reason these are left out for .NET Core.

Closes dotnet#1731
@jeffkl
Copy link
Contributor

@jeffkl jeffkl commented Feb 21, 2017

We already reference System.Xml.XmlDocument which depends on System.Xml.XPath and System.Xml.XPath.XmlDocument. So having them compiled in just worked. I've submitted a PR to see how it does on non-Windows...

@jeffkl
Copy link
Contributor

@jeffkl jeffkl commented Feb 22, 2017

I was wrong about the dependencies but I did get it building with XmlPeek and XmlPoke. I've updated the PR...

@jeffkl jeffkl closed this in #1732 Feb 23, 2017
jeffkl added a commit that referenced this issue Feb 23, 2017
* Enable XmlPeek and XmlPoke, tasks for .NET Core.
* Include unit tests as well
* Rewrite some XmlPoke unit tests to not use regular expressions because differing line breaks on different platforms was causing the indexes to be off.  The tests now parse the modified XML to verify everything.

Closes #1731
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.