I'm attempting to demonstrate a simple Castle Windsor edge case using dotnetfiddle.
When it tries to run this code
var container = new WindsorContainer()
.Register(Component.For<TestClass>()
.LifeStyle.Singleton
.OnDestroy(t => t.ByeBye())
);
It gets this error
Run-time exception (line 42): Inheritance security rules violated while overriding member: 'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.
Stack Trace:
[System.TypeLoadException: Inheritance security rules violated while overriding member: 'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.] at Program.Main(String[] args): line 42
Is there a way to get Castle Windsor to work with.NET fiddle?
Here's the link to the.NET fiddle share: https://dotnetfiddle.net/crBGpt