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

Enhance msb4064 unexpected task attribute error #5945

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 24 additions & 7 deletions src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs
Expand Up @@ -1098,13 +1098,30 @@ out parameterSet
else
{
// flag an error if we find a parameter that has no .NET property equivalent
_taskLoggingContext.LogError
(
new BuildEventFileInfo(parameterLocation),
"UnexpectedTaskAttribute",
parameterName,
_taskName
);
if (_taskFactoryWrapper.TaskFactoryLoadedType.LoadedAssembly is null)
{
_taskLoggingContext.LogError
(
new BuildEventFileInfo( parameterLocation ),
"UnexpectedTaskAttribute",
parameterName,
_taskName,
_taskFactoryWrapper.TaskFactoryLoadedType.Type.Assembly.FullName,
_taskFactoryWrapper.TaskFactoryLoadedType.Type.Assembly.Location
);
}
else
{
_taskLoggingContext.LogError
(
new BuildEventFileInfo( parameterLocation ),
"UnexpectedTaskAttribute",
parameterName,
_taskName,
_taskFactoryWrapper.TaskFactoryLoadedType.LoadedAssembly.FullName,
_taskFactoryWrapper.TaskFactoryLoadedType.LoadedAssembly.Location
);
}
}
}
catch (AmbiguousMatchException)
Expand Down
2 changes: 1 addition & 1 deletion src/Build/Resources/Strings.resx
Expand Up @@ -1225,7 +1225,7 @@
<comment>{StrBegin="MSB4091: "}</comment>
</data>
<data name="UnexpectedTaskAttribute" xml:space="preserve">
<value>MSB4064: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a settable public instance property.</value>
<value>MSB4064: The "{0}" parameter is not supported by the "{1}" task loaded from assembly: {2} from the path: {3}. Verify that the parameter exists on the task, the UsingTask points to the correct assembly and it is a settable public instance property.</value>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super-nit: In many other error messages mentioning UsingTask I see it wrapped in angle brackets making it clear that it refers to an XML element. Also, a comma before the last and would be more consistent with the style of the rest of this file.

<comment>{StrBegin="MSB4064: "}</comment>
</data>
<data name="UnexpectedTaskOutputAttribute" xml:space="preserve">
Expand Down
4 changes: 2 additions & 2 deletions src/Build/Resources/xlf/Strings.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Build/Resources/xlf/Strings.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Build/Resources/xlf/Strings.en.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Build/Resources/xlf/Strings.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Build/Resources/xlf/Strings.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Build/Resources/xlf/Strings.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Build/Resources/xlf/Strings.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Build/Resources/xlf/Strings.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Build/Resources/xlf/Strings.pl.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Build/Resources/xlf/Strings.pt-BR.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Build/Resources/xlf/Strings.ru.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Build/Resources/xlf/Strings.tr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Build/Resources/xlf/Strings.zh-Hans.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Build/Resources/xlf/Strings.zh-Hant.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.