Hi,
all my RavenDB tests throwing "System.InvalidProgramException : Common Language Runtime detected an invalid program"
when attempting to execute raven index running under NCrunch. Stack trace snapshot below
System.TypeInitializationException : The type initializer for 'ICSharpCode.NRefactory.CSharp.AstNode' threw an exception.
----> System.InvalidProgramException : Common Language Runtime detected an invalid program.
at ICSharpCode.NRefactory.CSharp.AstNode..ctor()
at ICSharpCode.NRefactory.CSharp.EntityDeclaration..ctor()
at ICSharpCode.NRefactory.CSharp.TypeDeclaration..ctor()
at Raven.Database.Linq.DynamicViewCompiler.TransformQueryToClass() in c:BuildsRavenDB-StableRaven.DatabaseLinqDynamicViewCompiler.cs:line 51
at Raven.Database.Linq.DynamicViewCompiler.GenerateInstance() in c:BuildsRavenDB-StableRaven.DatabaseLinqDynamicViewCompiler.cs:line 594
at Raven.Database.Storage.IndexDefinitionStorage.AddAndCompileIndex(IndexDefinition indexDefinition) in c:BuildsRavenDB-StableRaven.DatabaseStorageIndexDefinitionStorage.cs:line 233
at Raven.Database.Storage.IndexDefinitionStorage.CreateAndPersistIndex(IndexDefinition indexDefinition) in c:BuildsRavenDB-StableRaven.DatabaseStorageIndexDefinitionStorage.cs:line 180
at Raven.Database.DocumentDatabase.PutIndex(String name, IndexDefinition definition) in c:BuildsRavenDB-StableRaven.DatabaseDocumentDatabase.cs:line 1207
at Raven.Client.Embedded.EmbeddedDatabaseCommands.PutIndex(String name, IndexDefinition definition, Boolean overwrite) in c:BuildsRavenDB-StableRaven.Client.EmbeddedEmbeddedDatabaseCommands.cs:line 429
at Raven.Client.Indexes.AbstractIndexCreationTask.Execute(IDatabaseCommands databaseCommands, DocumentConvention documentConvention) in c:BuildsRavenDB-StableRaven.Client.LightweightIndexesAbstractIndexCreationTask.cs:line 198
at Raven.Client.DocumentStoreBase.ExecuteIndex(AbstractIndexCreationTask indexCreationTask) in c:BuildsRavenDB-StableRaven.Client.LightweightDocumentStoreBase.cs:line 91
This can be reproduced with dummy test below
[Test]
public void Test()
{
using (var documentStore = new EmbeddableDocumentStore {RunInMemory = true}.Initialize())
{
documentStore.ExecuteIndex(new TestIndex());
}
}
Please advice.
Environment details: VS 2013, NCrunch 2.7.0.5, TypeMock 7.5.1
Thanks