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

Add url to warning/error tasks and objects #4029

Closed
sanderobdeijn opened this issue Dec 25, 2018 · 6 comments
Closed

Add url to warning/error tasks and objects #4029

sanderobdeijn opened this issue Dec 25, 2018 · 6 comments
Assignees
Labels
Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. Feature Request triaged
Milestone

Comments

@sanderobdeijn
Copy link

I'm making a .props file that reads some properties in a .csproj and then sets other properties and loads some nugetpackages.
I want to add errors or warnings when the properties are empty. So I added a warning tag that looks for a empty property.

Also I would like to add a link to a support page in visual studio. Can an url be added to this attribute.

The 1 code becomes an url in visualstudio but now points to a MDN page.
If I add a HelpKeyword attribute with an url the link in visual studio changes but not to the value of the help keyword.

How does this tag work? Can I set this tag to a specific url in visual studio?

Here is my code:

<Project InitialTargets="ValidateProjectParameters">
    <Target Name="ValidateProjectParameters">
        <Warning Text="The property TestProperty is empty in the projectfile"
                 Condition="'$(TestProperty)' == ''"
                 Code="1"
                 HelpKeyword="http://google.com">
    </Target>
</Project>
@livarcocc
Copy link
Contributor

This might be a better question to dotnet/project-system. I am not sure how VS leverages warnings coming from msbuild.

@davkean any idea?

@livarcocc livarcocc added this to the Discussion milestone Dec 25, 2018
@sanderobdeijn
Copy link
Author

In #3858 I was asked to open a separate issue.
What is the helpkeyword used for? If I do an dotnet build it also isn't returned in the output

@davkean
Copy link
Member

davkean commented Dec 27, 2018

HelpKeyword has a different meaning; it means the keyword that we use to look up a help topic in help. If MSBuild added a concept of HelpLink (which is what we call it in the error list), then we can plumb it through in the project system.

@rainersigwald rainersigwald added Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. Feature Request labels Feb 13, 2019
@rainersigwald rainersigwald changed the title How to add url to warning/error tag Add url to warning/error tasks and objects Feb 13, 2019
@jmezach
Copy link
Contributor

jmezach commented Jun 30, 2020

This would be a really useful feature to have in order to document your own set of context specific warnings. Any plans to add this?

@davkean
Copy link
Member

davkean commented Jul 1, 2020

I don't believe this is scheduled, but I'm sure that MSBuild will welcome the contribution. After that I can schedule some time on the VS side to make sure this all plumbed through.

Forgind pushed a commit that referenced this issue Jul 28, 2020
As discussed in #4029 (see this comment) I've added the ability to set a help link for both the Error and Warning tasks. This would allow authors of MSBuild targets to issue warnings and/or errors and point users to some page describing more details about the error/warning.
@davkean
Copy link
Member

davkean commented Aug 3, 2020

This has been merged in: #5488.

@davkean davkean closed this as completed Aug 3, 2020
@AR-May AR-May added the triaged label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. Feature Request triaged
Projects
None yet
Development

No branches or pull requests

6 participants