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

Notification

Icon
Error

Project Build Error after upgrading to v3.x from v2.27 in VS2015
srkinyon
#1 Posted : Tuesday, April 18, 2017 8:17:01 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/18/2017(UTC)
Posts: 2
Location: United States of America

A project that has run NCrunch for many months using v2.x stops building in VS2015 using NCrunch v3.2 & v3.6. Here is the error:

NCrunch: If you are experiencing problems in getting this project to build, have a look at http://www.ncrunch.net/d...ng_project-build-issues
System.InvalidOperationException: Operation is not valid due to the current state of the object.
at _Mono.Cecil.Cil.CodeReader.ReadMethodBody()
at _Mono.Cecil.Cil.CodeReader.ReadMethodBody(MethodDefinition method)
at _Mono.Cecil.MethodDefinition.<>c.<get_Body>b__36_0(MethodDefinition method, MetadataReader reader)
at _Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
at _Mono.Cecil.MethodDefinition.get_Body()
at nCrunch.Reflection.Cecil.CecilMethod.get_HasBody()

We tried rearranging the options using the Config Wizard but nothing makes it go away. None of the topics in "troubleshooting_project-build-issues" seem to apply.

Again, this project runs fine under v2.27 but fails using v3.x that was tried on two different VS installs against the same code base. Reinstalling v2.27 gets us working again but will prevent future upgrades until fixed.

Thanks!
Remco
#2 Posted : Tuesday, April 18, 2017 11:43:40 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for sharing this problem.

This looks to be caused by an IL arrangement in the assembly that the metadata reader isn't able to process. The exception itself looks to be downstream from the true problem ... I think this is going to be hard to track down.

Are you able to narrow this down to the code that triggers the problem? If I can reproduce it, I have a good chance of being able to fix it.

If you're using any IL-manipulation tools in your build system, try turning these off to see if this makes any difference.
srkinyon
#3 Posted : Wednesday, April 19, 2017 4:57:42 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 4/18/2017(UTC)
Posts: 2
Location: United States of America

"Are you able to narrow this down to the code that triggers the problem?"
- Sorry, there are many, many files in that project so I'm not sure I could isolate it. Is there a log file or some diagnostic that says which file it is failing on?

"If you're using any IL-manipulation tools in your build system, try turning these off to see if this makes any difference."
- We don't have anything like that directly, but we have DevExpress integrated and they have a MVVM system that might possibly have post processing. We also use MEF and that may have a conflict?

Other that those tools, we don't have anything that should working in the IL realm (that I know about).

Since it works fine in 2.27, is there some area in 3.x that would have changed that would conflict with WPF? It is specifically failing in the WPF project and the other projects build fine.
Remco
#4 Posted : Wednesday, April 19, 2017 5:07:49 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
srkinyon;10300 wrote:

- Sorry, there are many, many files in that project so I'm not sure I could isolate it. Is there a log file or some diagnostic that says which file it is failing on?


Understood. This is usually the case with these sorts of problems :( There are no logs detailed enough to catch this kind of activity because there is so much data involved. If I had a copy of the DLL itself, I might be able to troubleshoot, though usually IP restrictions make this impossible.

srkinyon;10300 wrote:

- We don't have anything like that directly, but we have DevExpress integrated and they have a MVVM system that might possibly have post processing. We also use MEF and that may have a conflict?


To my knowledge, MEF is primarily a run-time concern and doesn't involve static manipulation. DevExpress have been known to introduce their own build steps, so IL manipulation is a possibility. I recommend examining the project XML to see if it imports any .targets files that are outside the standard MS tech stack. Removing these imports temporarily (if they exist) might be an interesting test.

srkinyon;10300 wrote:

Since it works fine in 2.27, is there some area in 3.x that would have changed that would conflict with WPF? It is specifically failing in the WPF project and the other projects build fine.


The only thing I can think of here is that v3 introduced IL-level impact detection, which involves extra analysis (hashing) to be performed on the output DLLs. From memory, v3 didn't include any changes that would affect the actual reading of the DLL itself, but the impact detection might be surfacing the issue just because it runs over more of your code. You might want to try setting your impact detection mode (global/solution setting) to 'WatchText' to see if this makes any difference.
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.036 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download