Create dynamic class that implements interface with static properties
Sorry for the PowerShell but I'm trying to figure out how to create a class that implements an interface with a static property and I have the following
It's failing with
It's failing with
Exception calling "CreateType" with "0" argument(s): "Virtual static method 'get_Id' is not implemented on type 'MyClass' from assembly 'MyAssembly, Version=0.0.0.0,Culture=neutral, PublicKeyToken=null'."Looking at the IL code in sharplab.io for the equivalent C# code doesn't have anything jumping out at me https://sharplab.io/#v2:C4LglgNgPgAgzAAjAO2AUwE4DMCGBjNBASQAUMB7AB02AE8BYAKAG8mF2EYBGANgRwBGAZ2AZ8wJKmIATBMwQBzNMADcCAL5NNjJvE4AmBAGEAygAscGSmSo1aCEMRvUMdJq0YdOibnxQSiWXklCQBeAD4ELjVtdSA==. When adding the
MethodAttributes.Virtual to the get_Id method builder it fails saying methods can't be static and virtual. Am I just missing something simple or is there something else I need to do here?C#/VB/F# compiler playground.