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

GenerateBindingRedirects task emits warning without code - unable to suppress #69

Open
Yozer opened this issue Sep 27, 2023 · 3 comments
Assignees
Labels
hacktoberfest An issue which is part of hacktoberfest

Comments

@Yozer
Copy link

Yozer commented Sep 27, 2023

I'm using /warnaserror msbuild switch to enable warnings as errors.
Currently, the messages about the bindings are warnings and the switch turns them into red error.

<Warning Condition="'$(GeneratedBindingRedirectsAction)' == 'Overwrite'"
             File="Web.config"
             Text="Generated Binding Redirects have been applied automatically to the Web.config. This warning will disappear on the next build." />

Proposals:

  1. Replace them with Messages
  2. Add custom Code to Warnings so people can suppress them.

Messages with high importance would be a better joice but let me know. I'm happy to send a PR with either change.

@CZEMacLeod
Copy link
Owner

@Yozer I don't think messages can include a file reference for 1 thing, and it is a warning - that the source was modified by the build process and that you may need to execute the build again for a 'clean' compile.
I certainly agree that adding a code to the warning would not be a bad thing to do, to allow sorting and, in your case, supressing the error.

If you are doing a PR, please take into account the open PR #61 which will move the warnings etc.

If you base your change off that PR, I will pull them both in on the next release.

@Yozer
Copy link
Author

Yozer commented Oct 5, 2023

@CZEMacLeod thanks for the response.
Having code on the warning would also work.
It's just adding one line to the Warning task:
Code="WHAT123"
I'm not sure what prefix would be best there. Same code for all the warnings?

@CZEMacLeod
Copy link
Owner

@Yozer I think each warning should be different. Indeed, the whole project should ensure we have messages, but that might have to be a separate issue/pr.
I think the code prefix should be SWSDK (for System.Web SDK) but if you have a better/different idea, I'm open to suggestions.
For these can we go with 100-10x for the codes. (I think there are 3 messages in the binding redirects section).
It might be useful to add the information to the docs to make it easier to search for the code too.

@CZEMacLeod CZEMacLeod added the hacktoberfest An issue which is part of hacktoberfest label Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest An issue which is part of hacktoberfest
Projects
None yet
Development

No branches or pull requests

2 participants