You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeInitializationException with SyncrhonizationLockException being thrown when instantiating Mocks . This was thrown for all the tests in the class. This issue happened once in our pipelines but it didn't occur locally. Or in any of the later builds.
Steps to Reproduce
Expected Behavior
The initialization should go through
Exception with Stack Trace
System.TypeInitializationException : The type initializer for 'Moq.ProxyFactory' threw an exception.
build 18-Jan-2024 08:40:56 ---- System.Threading.SynchronizationLockException : Object synchronization method was called from an unsynchronized block of code.
build 18-Jan-2024 08:40:56 Stack Trace:
build 18-Jan-2024 08:40:56 //src/Moq/Guard.cs(113,0): at Moq.Guard.IsVisibleToProxyFactory(MethodInfo method)
build 18-Jan-2024 08:40:56 //src/Moq/MethodExpectation.cs(240,0): at Moq.MethodExpectation..ctor(LambdaExpression expression, MethodInfo method, IReadOnlyList1 arguments, Boolean exactGenericTypeArguments, Boolean skipMatcherInitialization, Boolean allowNonOverridable) build 18-Jan-2024 08:40:56 /_/src/Moq/ExpressionExtensions.cs(240,0): at Moq.ExpressionExtensions.<Split>g__Split|5_0(Expression e, Expression& r, MethodExpectation& p, Boolean assignment, Boolean allowNonOverridableLastProperty) build 18-Jan-2024 08:40:56 /_/src/Moq/ExpressionExtensions.cs(171,0): at Moq.ExpressionExtensions.Split(LambdaExpression expression, Boolean allowNonOverridableLastProperty) build 18-Jan-2024 08:40:56 /_/src/Moq/Mock.cs(562,0): at Moq.Mock.Setup(Mock mock, LambdaExpression expression, Condition condition) build 18-Jan-2024 08:40:56 /_/src/Moq/Mock1.cs(645,0): at Moq.Mock1.Setup[TResult](Expression1 expression)
Put the exception with stack trace here.
Version Info
Moq version 4.20.70
Moq.AutoMock Version 3.5.0
Additional Info
The text was updated successfully, but these errors were encountered:
Describe the Bug
TypeInitializationException with SyncrhonizationLockException being thrown when instantiating Mocks . This was thrown for all the tests in the class. This issue happened once in our pipelines but it didn't occur locally. Or in any of the later builds.
Steps to Reproduce
Expected Behavior
The initialization should go through
Exception with Stack Trace
System.TypeInitializationException : The type initializer for 'Moq.ProxyFactory' threw an exception.
build 18-Jan-2024 08:40:56 ---- System.Threading.SynchronizationLockException : Object synchronization method was called from an unsynchronized block of code.
build 18-Jan-2024 08:40:56 Stack Trace:
build 18-Jan-2024 08:40:56 //src/Moq/Guard.cs(113,0): at Moq.Guard.IsVisibleToProxyFactory(MethodInfo method)
build 18-Jan-2024 08:40:56 //src/Moq/MethodExpectation.cs(240,0): at Moq.MethodExpectation..ctor(LambdaExpression expression, MethodInfo method, IReadOnlyList
1 arguments, Boolean exactGenericTypeArguments, Boolean skipMatcherInitialization, Boolean allowNonOverridable) build 18-Jan-2024 08:40:56 /_/src/Moq/ExpressionExtensions.cs(240,0): at Moq.ExpressionExtensions.<Split>g__Split|5_0(Expression e, Expression& r, MethodExpectation& p, Boolean assignment, Boolean allowNonOverridableLastProperty) build 18-Jan-2024 08:40:56 /_/src/Moq/ExpressionExtensions.cs(171,0): at Moq.ExpressionExtensions.Split(LambdaExpression expression, Boolean allowNonOverridableLastProperty) build 18-Jan-2024 08:40:56 /_/src/Moq/Mock.cs(562,0): at Moq.Mock.Setup(Mock mock, LambdaExpression expression, Condition condition) build 18-Jan-2024 08:40:56 /_/src/Moq/Mock
1.cs(645,0): at Moq.Mock1.Setup[TResult](Expression
1 expression)Version Info
Moq version 4.20.70
Moq.AutoMock Version 3.5.0
Additional Info
The text was updated successfully, but these errors were encountered: