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
[API Proposal]: Make AddBinaryFormattedResource obsolete #88217
Comments
Tagging subscribers to this area: @dotnet/area-system-resources Issue DetailsBackground and motivationMost of the remaining legacy serialization APIs were obsoleted in #84383. I'm proposing that we obsolete the System.Resources.Extensions.PreserializedResourceWriter.AddBinaryFormattedResource method as well. I ran this by Levi and some others in an email: From: Rainer Sigwald Yeah, I’d be totally fine with obsoleting it but we will need it to keep working indefinitely. It’ll be an important scenario for a long time to support targeting .NET Framework apps from From: Eric St. John As you mention, it doesn’t itself use BinaryFormatter. It’s just writing resource data to a .resources format that will be treated as binary formatted data when that .resources file is eventually loaded. We could obsolete it, the only person using it right now is MSBuild and they’ll just suppress that obsoletion because they need to continue to support writing those resources – warnings need to go upstream where users choose this format. Adding the obsoletion here would discourage others from using it, imagining it as some kind of “safe” backdoor to getting binary-formatted resources loaded. I’m OK with us making it obsolete – but we can’t remove it. API Proposal[Obsolete ...]
public void AddBinaryFormattedResource(string name, byte[] value, string? typeName = null) API UsageN/A Alternative DesignsNo response RisksNo response
|
@rainersigwald is this OK to do in v8 - does |
Go ahead; when we get the new warning we'll add an exception in our codebase. |
namespace System.Resources.Extensions;
public partial class PreserializedResourceWriter
{
[Obsolete(...)]
public void AddBinaryFormattedResource(string name, byte[] value, string? typeName = null);
} |
Background and motivation
Most of the remaining legacy serialization APIs were obsoleted in #84383. I'm proposing that we obsolete the System.Resources.Extensions.PreserializedResourceWriter.AddBinaryFormattedResource method as well. I ran this by Levi and some others in an email:
From: Rainer Sigwald
Sent: Monday, June 26, 2023 7:09 AM
Subject: RE: AddBinaryFormattedResource method
Yeah, I’d be totally fine with obsoleting it but we will need it to keep working indefinitely. It’ll be an important scenario for a long time to support targeting .NET Framework apps from
dotnet build
.From: Eric St. John
Sent: Friday, June 23, 2023 5:17 PM
Subject: RE: AddBinaryFormattedResource method
As you mention, it doesn’t itself use BinaryFormatter. It’s just writing resource data to a .resources format that will be treated as binary formatted data when that .resources file is eventually loaded.
We could obsolete it, the only person using it right now is MSBuild and they’ll just suppress that obsoletion because they need to continue to support writing those resources – warnings need to go upstream where users choose this format.
Adding the obsoletion here would discourage others from using it, imagining it as some kind of “safe” backdoor to getting binary-formatted resources loaded. I’m OK with us making it obsolete – but we can’t remove it.
API Proposal
API Usage
N/A
Alternative Designs
No response
Risks
No response
The text was updated successfully, but these errors were encountered: