Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Funny Exception at nCrunch.Compiler.RemoteBuildRunner.Build
Jonh04
#1 Posted : Tuesday, February 4, 2014 6:14:07 PM(UTC)
Rank: Member

Groups: Registered
Joined: 3/13/2012(UTC)
Posts: 20

Thanks: 1 times
Was thanked: 3 time(s) in 2 post(s)
Given the interface

public interface IProxy
{
Task<IsAlive> IsAlive();
}

And this code in a [TestMethod]:

var fakeProxy = new Mock<IProxy>();
fakeProxy.Setup(x => x.IsAlive()).Throws(new Exception());

This exception happens:

System.NotImplementedException: 26
at Mono.Cecil.SignatureReader.GetPrimitiveType(ElementType etype)
at Mono.Cecil.SignatureReader.ReadTypeSignature(ElementType etype)
at Mono.Cecil.SignatureReader.ReadGenericInstanceSignature(IGenericParameterProvider provider, IGenericInstance instance)
at Mono.Cecil.MetadataReader.ReadMethodSpecSignature(UInt32 signature, MethodReference method)
at Mono.Cecil.MetadataReader.GetMethodSpecification(UInt32 rid)
at Mono.Cecil.MetadataReader.LookupToken(MetadataToken token)
at Mono.Cecil.Cil.CodeReader.ReadOperand(Instruction instruction)
at Mono.Cecil.Cil.CodeReader.ReadCode()
at Mono.Cecil.Cil.CodeReader.ReadFatMethod()
at Mono.Cecil.Cil.CodeReader.ReadMethodBody()
at Mono.Cecil.Cil.CodeReader.ReadMethodBody(MethodDefinition method)
at Mono.Cecil.MethodDefinition.<get_Body>b__2(MethodDefinition method, MetadataReader reader)
at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
at Mono.Cecil.MethodDefinition.get_Body()
at #=qvR9ZGzr8CCovl$1ZWXK_eLSjLaTI$uMOxs5cPgahDsVPhHLAiMkRuYX2b7PCfOrQccB2uJ8zwPMfRMvpt34vXA==.#=qAEZbinkhejjF4v9bhob4UkqEAL72x4cJX3Du$heNR7Q=(Collection`1 #=q7S0drwuwEUY3jUk9GvSG4Q==)
at #=qvR9ZGzr8CCovl$1ZWXK_eLSjLaTI$uMOxs5cPgahDsVPhHLAiMkRuYX2b7PCfOrQccB2uJ8zwPMfRMvpt34vXA==.#=qTBxJhN4WsTDxiWu4AKHFiR1KJ0rMIJZYEFmt8pH44gY=(IEnumerable`1 #=qq_2NgUCzmnANBGcs65uzqg==)
at #=qvR9ZGzr8CCovl$1ZWXK_eLSjLaTI$uMOxs5cPgahDsVPhHLAiMkRuYX2b7PCfOrQccB2uJ8zwPMfRMvpt34vXA==.#=qcM9x4PpSoSvdqeACaAo55E4F96lpuE_zPZZ$5hwKu$8=()
at nCrunch.Compiler.StaticManipulation.BuiltAssembly.Instrument(ComponentSourceLineMap sourceLineMap, IDictionary`2 instrumentationDirectivesByCodeFileId, IDictionary`2 codeFileIDsByFilePath, Boolean proxyProcessIsActive, Int32 componentId, IInstrumentationFilter[] instrumentationFilters)
at nCrunch.Compiler.RemoteBuildRunner.#=qqZ$biBs7mvGRD42no0zcEfaWi4v$NuLBVy7NcKpqVcU=(ComponentBuildParameters #=q8_ZGEckiLbRsUjNXvAaKOg==, FilePath #=qkb_tmWgu4KtzCWen$hSPsMPrQ1mkbV0Q2nGsXkZrK6s=, BuildOutput #=qnXDAQpnfqAeJl0p31Gcd1w==, DirectoryPath[] #=qSofaDjiwWEBgv$s22DxHPsKSbp4hruna3jReeOLGOyg=, FilePath[] #=qfLDmMJzWXbDJK4KiH6tg6MwNo8hcfZSKZe0YwSutOdtYLr7gvxG6$V$9q044oc1x)
at nCrunch.Compiler.RemoteBuildRunner.Build(ComponentBuildParameters parameters)

Changing from Moq to FakeItEasy give the following:

System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)


Apparently it was missing a reference to the project holding IsAlive.

Ncrunch 2.4.0.2


Thanks
Remco
#2 Posted : Tuesday, February 4, 2014 11:28:41 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Thanks for sharing this. Just to clarify - is the issue still present for you now? Or did it go away after you added the project reference?

Also - what kind of type is 'IsAlive'? Is this an enum?

Cheers,

Remco
Jonh04
#3 Posted : Tuesday, February 4, 2014 11:36:21 PM(UTC)
Rank: Member

Groups: Registered
Joined: 3/13/2012(UTC)
Posts: 20

Thanks: 1 times
Was thanked: 3 time(s) in 2 post(s)
It resolved after adding the reference.

IsAlive is a class.

Cheers!
Remco
#4 Posted : Tuesday, February 4, 2014 11:45:07 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Excellent, thank you!
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.044 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download