PowerShell isn't required, per-se, to perform dynamic compilation of C# code, so your constraint of not utilizing PowerShell shouldn't be a factor. PowerShell does, however, make it easier to create an instance of a generic container bound to specific key/value types without dynamic compilation of C# code.