chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
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
asked by graduss (1.1k points)

2 Answers

0 votes
Hi,

Just posted a patch for this issue in this post
Let me know if it helps.
answered by alex (17k points)
0 votes
Hi,

The patch for this issue is available here.
Let me know if it helps.
answered by alex (17k points)
...