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

Notification

Icon
Error

PowerPoint Interop ConvertToAfterEffect Won't Compile in NCrunch 1.41.0.50b
tony722
#1 Posted : Tuesday, September 11, 2012 1:02:01 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/11/2012(UTC)
Posts: 1

I have the following in my code:
Code:
var effect = slide.TimeLine.MainSequence.AddEffect(shape, PPT.MsoAnimEffect.msoAnimEffectAppear, trigger: PPT.MsoAnimTriggerType.msoAnimTriggerAfterPrevious);      
slide.TimeLine.MainSequence.ConvertToAfterEffect(effect, PPT.MsoAnimAfterEffect.msoAnimAfterEffectHide);


Code compiles fine. Runs fine. Runs fine in MSTest.

NCrunch won't compile it giving the following excuse:
Quote:

[17:57:41.5761-BuildTask-21] ERROR (Compilation): PresentationBuilder3: (0): System.InvalidCastException: Specified cast is not valid.
at Mono.Cecil.SignatureWriter.WritePrimitiveValue(ElementType type, Object value)
at Mono.Cecil.MetadataBuilder.GetConstantSignature(ElementType type, Object value)
at Mono.Cecil.MetadataBuilder.AddConstant(IConstantProvider owner, TypeReference type)
at Mono.Cecil.MetadataBuilder.AddParameter(UInt16 sequence, ParameterDefinition parameter, ParamTable table)
at Mono.Cecil.MetadataBuilder.AddParameters(MethodDefinition method)
at Mono.Cecil.MetadataBuilder.AddMethod(MethodDefinition method)
at Mono.Cecil.MetadataBuilder.AddMethods(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddTypeDefs()
at Mono.Cecil.MetadataBuilder.BuildTypes()
at Mono.Cecil.MetadataBuilder.BuildModule()
at Mono.Cecil.ModuleWriter.<BuildMetadata>b__0(MetadataBuilder builder, MetadataReader _)
at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
at Mono.Cecil.ModuleWriter.BuildMetadata(ModuleDefinition module, MetadataBuilder metadata)
at Mono.Cecil.ModuleWriter.WriteModuleTo(ModuleDefinition module, Stream stream, WriterParameters parameters)
at Mono.Cecil.ModuleDefinition.Write(Stream stream, WriterParameters parameters)
at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters)
at nCrunch.Compiler.StaticManipulation.BuiltAssembly.#=q6gCeKWiBt6C3qKWXf6lGxLORytITHauyfYLMMEj4PDg=.#=q6y8gMwouK7$ZpvQ$SRm7HYr_OMYAvZNvlS0ZeITaYpI=()
at nCrunch.Compiler.StaticManipulation.BuiltAssembly.#=q7yp7R2vCg7OHrM_sd9tAMw==(Action #=qudRwucEzHbkdlwIjgyJfoQ==)
at nCrunch.Compiler.StaticManipulation.BuiltAssembly.Instrument(ComponentSourceLineMap sourceLineMap, IDictionary`2 instrumentationDirectivesByCodeFileId, IDictionary`2 codeFileIDsByFilePath, Boolean proxyProcessIsActive, Int32 componentId, IInstrumentationFilter[] instrumentationFilters)
at nCrunch.Compiler.RemoteBuildRunner.#=qvNS9Jn_vovPYj$WawPTGDERaQEDfCgulsnXs2PU1wgs=(ComponentBuildParameters #=qGqyIDwsobZMazZ7Y1gEPOQ==, String #=qW2BTg7$3D$rwxs42Kghci$GtNcbbtkdxQLoeiTTjqjM=, BuildOutput #=q6F$cbteKcyUjRVn$ntQutw==, String #=q3QIyw1sHCANAHQHwaUeDi7oPFizAEqs90a5hwUHrid8=)
at nCrunch.Compiler.RemoteBuildRunner.Build(ComponentBuildParameters parameters)


The following workaround allows NCrunch to compile:
Code:
var effect = slide.TimeLine.MainSequence.AddEffect(shape, PPT.MsoAnimEffect.msoAnimEffectAppear, trigger: PPT.MsoAnimTriggerType.msoAnimTriggerAfterPrevious);      
dynamic seq = slide.TimeLine.MainSequence;
seq.ConvertToAfterEffect(effect, PPT.MsoAnimAfterEffect.msoAnimAfterEffectHide);


Is this by design, am I doing something wrong, or is it an NCrunch bug?

Thanks,

Tony

Running NCrunch 1.41.0.50b in Visual Studio 2010 SP1
Remco
#2 Posted : Tuesday, September 11, 2012 9:36:54 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Tony -

Thanks for reporting this issue. It looks as though the syntax of this particular method call is creating a rare IL arrangement that NCrunch isn't able to process. I'll note it down for a future fix.


Thanks!

Remco
Users browsing this topic
Guest (2)
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.033 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download