Open GoogleCodeExporter opened 9 years ago
I am also seeing this issue using .NET 4.0, MOQ 4.0.10827, Win 7 x64, Moles
0.94.51023.0. The exception detail is:
System.TypeInitializationException was unhandled by user code
Message=The type initializer for 'MyCompany.UnitTests.Framework.UnitTestBase' threw an exception.
Source=MyCompany.UnitTests.Framework
TypeName=MyCompany.UnitTests.Framework.UnitTestBase
StackTrace:
at MyCompany.UnitTests.Framework.UnitTestBase.get_Container()
at MyCompany.UnitTests.Client.Features.DocumentsViewModel.DocumentOverViewViewModelTestWithMoq.RegisterDependencies() in D:\Project\SuperDepartment\DocuMagic\Development\Mudders\MyCompany\UnitTests\Client\Features\DocumentModuleTests\DocumentOverViewViewModelTestWithMoq.cs:line 265
at MyCompany.UnitTests.Client.Features.DocumentsViewModel.DocumentOverViewViewModelTestWithMoq.ClassInitialize(TestContext context) in D:\Project\SuperDepartment\DocuMagic\Development\Mudders\MyCompany\UnitTests\Client\Features\DocumentModuleTests\DocumentOverViewViewModelTestWithMoq.cs:line 42
InnerException: System.TypeInitializationException
Message=The type initializer for 'Moq.Extensions' threw an exception.
Source=Moq
TypeName=Moq.Extensions
StackTrace:
at Moq.Extensions.ThrowIfNotMockeable(Type typeToMock)
at Moq.Mock`1.CheckParameters()
at Moq.Mock`1..ctor(MockBehavior behavior, Object[] args)
at Moq.Mock`1..ctor(MockBehavior behavior)
at Moq.Mock`1..ctor()
at MyCompany.UnitTests.Framework.FakeEntities.get_DocuMagicUserInfo() in D:\Project\SuperDepartment\DocuMagic\Development\Mudders\MyCompany\UnitTests\Framework\FakeEntities.cs:line 105
at MyCompany.UnitTests.Framework.UnitTestBase.RegisterDependencies() in D:\Project\SuperDepartment\DocuMagic\Development\Mudders\MyCompany\UnitTests\Framework\UnitTestBase.cs:line 44
at MyCompany.UnitTests.Framework.UnitTestBase.Initialize() in D:\Project\SuperDepartment\DocuMagic\Development\Mudders\MyCompany\UnitTests\Framework\UnitTestBase.cs:line 37
at MyCompany.UnitTests.Framework.UnitTestBase..cctor() in D:\Project\SuperDepartment\DocuMagic\Development\Mudders\MyCompany\UnitTests\Framework\UnitTestBase.cs:line 17
InnerException: System.Security.VerificationException
Message=Operation could destabilize the runtime.
Source=Moq
StackTrace:
at Moq.Extensions..cctor()
InnerException:
Original comment by Digi...@gmail.com
on 12 Jul 2012 at 7:08
Original issue reported on code.google.com by
mgress...@gmail.com
on 6 Jun 2012 at 8:04