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

Enable error when using BinaryFormatter in GenerateResource #32981

Merged
merged 3 commits into from
Jun 13, 2023

Conversation

Forgind
Copy link
Member

@Forgind Forgind commented Jun 1, 2023

When GenerateResourceWarnOnBinaryFormatterUse is true and GenerateResource executes and ultimately uses BinaryFormatter, it throws a warning. This is to enable that warning when building from the SDK.

@dsplaisted, is this the best way to set that property? I noticed that Microsoft.NET.Sdk.props is imported in things like Sdk.props and the Razor SDK; adding Sourcelink.props (I think) adds C++ scenarios...what scenarios am I missing, and is there a single central location that would hit everything?

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Jun 1, 2023
@JanKrivanek
Copy link
Member

I have a lack ow knowledge here - what will happen if one tries to dotnet build app targeting Full FW? We probably do not want to enable this check there by default - do we?

@dsplaisted
Copy link
Member

Is there something that you can refer to giving some more background on this change?

Does it need to be set in a .props file? If you set it in Microsoft.NET.Sdk.targets, I think it would cover C++ as well as other cases.

Should we include tests for using this property? Should you be able to turn it off?

@JanKrivanek
Copy link
Member

Related: dotnet/msbuild#8827
We want to get idea of BinaryFormatter usages - internal and external - via GenerateResource task. This is needed to:

  • Properly plan the replacement/deprecation
  • To properly suggest the viable deprecation timelines (net8 vs net9)

Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

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

This should be in targets and it should be enabled only when targeting .NET 8+.

cc @merriemcgaw @JeremyKuhne

@marcpopMSFT marcpopMSFT merged commit ab94a76 into dotnet:main Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants