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
Have the XmlPeek task query XML such that at least one result will be a zero-length string. Include an Output element that uses the ItemName attribute.
XmlPeek throws exception with text pointing to the root cause, e.g.
C:\foo\repro.proj(27,7): error MSBXXXX: The "XmlPeek" task results included one or more zero length strings. "_DriftAdditions" parameter "Include" cannot have zero length.
Actual behavior
XmlPeek throws an exception with text that makes it difficult to infer the root cause.
Using "XmlPeek" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "XmlPeek" (TaskId:2)
Task Parameter:XmlContent=<DriftReport xmlns="http://schemas.microsoft.com/sqlserver/dac/DriftReport/2012/02">
<Additions>
<Object Name="" Parent="[db_owner]" Type="SqlRoleMembership" />
<Object Name="[foo\foo]" Parent="" Type="SqlUser" />
</Additions>
<Removals />
<Modifications />
</DriftReport> (TaskId:2)
Task Parameter:Namespaces= (TaskId:2)
Task Parameter:Query=/dr:DriftReport/dr:Additions/*[local-name()='Object' and not(@type='dummy value')]/@name (TaskId:2)
Found "". (TaskId:2)
Found "[foo\foo]". (TaskId:2)
C:\foo\repro.proj(27,7): error MSB4028: The "XmlPeek" task's outputs could not be retrieved from the "Result" parameter. Parameter "includeEscaped" cannot have zero length.
Done executing task "XmlPeek" -- FAILED. (TaskId:2)
Environment data
msbuild /version output:
Microsoft (R) Build Engine version 15.7.179.6572 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Steps to reproduce
Have the
XmlPeek
task query XML such that at least one result will be a zero-length string. Include anOutput
element that uses theItemName
attribute.Project file (
repro.proj
)Directory contents:
Command line:
Expected behavior
XmlPeek
throws exception with text pointing to the root cause, e.g.Actual behavior
XmlPeek
throws an exception with text that makes it difficult to infer the root cause.Environment data
msbuild /version
output:Key line from MSBuild source
XmlPeek.Execute()
adds an invalidItem
, with empty string as itsIdentity
/Include
value:https://github.com/Microsoft/msbuild/blob/9ed9a33898750567e1ac653174038e542158cf02/src/Tasks/XmlPeek.cs#L247
The text was updated successfully, but these errors were encountered: