Use code generation instead of a reflection-based serializer for ASN (BER/DER) data.
Code generation solves a couple problems that the current serialization mechanism has (while maintaining the goodness):
* When deserialization fails it's really hard to debug why
* Solution: The genenerated code makes it easier to do things like break after a specific field decode.
* Reflection problems (rd.xml interactions, field ordering guarantees, etc)
* Solution: It's not reflection
* Perf
* Benchmarks say that the generated code is ~50x faster than the serializer
* Some of the sanity checks from the serializer can be moved into #if DEBUG cctors for one-shot verification
The principles for this generator were:
* Avoid the paradigm of "run this tool and check in the output"
* Use inbuilt MSBuild tasks (in this case XslTransformation)
Since MSBuild for .NET Core doesn't have the XslTransformation class it's a combination of "freshly built" and "checked in" for the time being.
This change only converts two types from the serializer to the generator. Others will happen in followup PRs.
Commit migrated from https://github.com/dotnet/corefx/commit/
50edd57cbc39f02234a8423125746941c211af13