https://github.com/dotnet/corefx/issues/37942 - resx doesn't require type information for binary formatted blobs
https://github.com/dotnet/corefx/issues/37711 - resx doesn't know what types are primitive types and safe to deserialize, giving it that knowledge would leak implementation details from the writer
To fix these issues were changing the existing API as follows:
```c#
public sealed partial class PreserializedResourceWriter : System.Resources.IResourceWriter
{
// removed: public void AddTypeConverterResource(string name, string typeName, string value) { }
// note name change
public void AddResource(string name, string value, string typeName) { }
// removed: public void AddBinaryFormattedResource(string name, string typeName, byte[] value) { }
// note: below now allows null
public void AddBinaryFormattedResource(string name, byte[] value, string typeName = null) { }
// below just reorder type argument to be last.
// removed: public void AddActivatorResource(string name, string typeName, System.IO.Stream value, bool closeAfterWrite = false) { }
public void AddActivatorResource(string name, System.IO.Stream value, string typeName, bool closeAfterWrite = false) { }}
// removed: public void AddTypeConverterResource(string name, string typeName, byte[] value) { }
public void AddTypeConverterResource(string name, byte[] value, string typeName) { }
```
See https://github.com/dotnet/corefx/pull/38012/commits/162b088800a292a78573ca09cc7745fb5765e524#diff-aaaa7dceb44b8c0504afbb510b224d91R20
https://github.com/dotnet/corefx/pull/38272/files#diff-aaaa7dceb44b8c0504afbb510b224d91L9
First round of changes went in. Getting more feedback on that and will mop up that with a follow up PR.
@dotnet/fxdc
Alright this looks good to me, unless someone objects, I'll approve this by EOD.
Assuming that
```C#
// removed: public void AddTypeConverterResource(string name, string typeName, byte[] value) { }
public void AddTypeConverterResource(string name, string typeName, byte[] value) { }
actually meant
```C#
// removed: public void AddTypeConverterResource(string name, string typeName, byte[] value) { }
public void AddTypeConverterResource(string name, byte[] value, string typeName) { }
(moving typeName to last, like in the PR)
LGTM.
Thanks, fixed the issue body. 馃
Fixed in dotnet/corefx#38272
Most helpful comment
Thanks, fixed the issue body. 馃