Our continuous integration builds on Azure DevOps just started having this problem running MSTest unit tests. Didn't update any of this code. Happening with Unity.Container.dll version 5.11.11.0 s well as 5.11.8.0 on older projects. Not able to reproduce locally in visual studio. any ideas?? Testng c# class libraries using .net Framework 4.8. This is the code in TestInitialize:
var container = new UnityContainer();
Initialization method MyTestClass.ATestInitialize threw exception. System.TypeInitializationException: The type initializer for 'Unity.Lifetime.TransientLifetimeManager' threw an exception. ---> System.Security.VerificationException: Operation could destabilize the runtime..
Stack trace at Unity.Lifetime.TransientLifetimeManager..cctor() in C:\projects\abstractions\src\Lifetime\Managers\TransientLifetimeManager.cs:line 26
This is using an Azure Pipelines agent pool running Windows 2019.