Skip to content

Instantly share code, notes, and snippets.

@kevingosse
Created February 1, 2019 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevingosse/a4a59fafd4145eed067b3909ed3a862e to your computer and use it in GitHub Desktop.
Save kevingosse/a4a59fafd4145eed067b3909ed3a862e to your computer and use it in GitHub Desktop.
internal class StartupHook
{
public static void Initialize()
{
var type = Type.GetType("System.Array+EmptyArray`1");
var arrayStringType = type.MakeGenericType(typeof(string));
var field = arrayStringType.GetField("Value", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic);
field.SetValue(null, new string[] { "Hello world!" });
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment