Hi all,
I just downloaded NCrunch 1.34b and enabled it on a rather large Visual Studio 2010 solution with hundreds of NUnit tests.
On quite a few tests I am see an exception, "System.InvalidProgramException : Common Language Runtime detected an invalid program.".
However, the tests run successfully when I run them using Resharper 6.
Has anyone seen this problem before?
Cheers,
Brendan
Build/Test Issues
InvalidProgramException on certain tests in solution
Started by BrendanBurns on 10,947 views
Remco NCrunch Developer
#457
30 Sep 2011 07:34 UTC
Hi Brendan,
This sounds like an instrumentation problem. There's been a few of these floating around.
Usually this is caused by interesting/rare IL arrangements that get messed up when NCrunch processes an assembly after it's been built. You'll probably find that there's one method that is causing it.
Is there any chance you may be post any details about the method where this is happening? This can help me to figure out what is unique about it that is causing NCrunch to fail.
Cheers,
Remco
This sounds like an instrumentation problem. There's been a few of these floating around.
Usually this is caused by interesting/rare IL arrangements that get messed up when NCrunch processes an assembly after it's been built. You'll probably find that there's one method that is causing it.
Is there any chance you may be post any details about the method where this is happening? This can help me to figure out what is unique about it that is causing NCrunch to fail.
Cheers,
Remco
I have a similar problem. I sent one case with the bug report tool. In this case the code which had the error was long and complicated, but I could narrow it down to:
If I remove any of the unused vars, I don't get the error anymore. Weird.
Private Class SomeClass
Public Property SomeIntProperty As Integer
Public Property SomeOtherIntProperty As Integer
Public Property SomeBooleanProperty As Boolean
Public Property SomeStringProperty As String
End Class
Private Sub Test()
Dim someUnusedVar As Integer
Dim dict As New Dictionary(Of String, List(Of SomeClass))
Dim enumerable As IEnumerable(Of SomeClass)
Dim anotherUnusedVar As Integer
For Each enumerableItem In enumerable
Dim list As List(Of SomeClass)
For Each listItem In list
Dim oneMoreUnusedVar As Integer = 3
Dim cl As New SomeClass
If 1 >= cl.SomeIntProperty Then
Dim otherObj As New SomeClass
otherObj.SomeIntProperty = 0
otherObj.SomeBooleanProperty = (1 <= cl.SomeOtherIntProperty)
dict(enumerableItem.SomeStringProperty).Add(otherObj)
End If
Next
Next
End Sub
If I remove any of the unused vars, I don't get the error anymore. Weird.
Edited 07 Dec 2011 18:05 UTC
Here's another isolated method which fails with the same error:
Private Class SomeClass
Property SomeDoubleProp As Double
End Class
Private Sub Test()
Dim myList As New List(Of SomeClass)
Dim unusedBoolValue As Boolean = False
Dim intValue As Integer
If (intValue > 0) Then
Dim doubleValue As Double = 0.0
Dim index As Integer = 0
While (index < myList.Count)
If (index <> 0) Then
doubleValue += myList(index).SomeDoubleProp
End If
index += 1
End While
End If
End Sub
Remco NCrunch Developer
#692
07 Dec 2011 21:16 UTC
Excellent! Thank you ... it's not always easy to reproduce these problems. I'll take a look at this and will see if I can get a fix introduced.
Remco NCrunch Developer
#703
08 Dec 2011 10:42 UTC
It looks like this was being caused by a certain IL arrangement that the instrumentation didn't handle too well. You can probably work around it by splitting this code up into smaller methods or by turning off the instrumentation. A fix for this issue will be in the 1.36b release, due out before Christmas.
I'll try to work around it in the meantime by splitting into smaller methods (in 2 out of 3 cases, this is needed anyway, these methods are too long!).
Thanks a lot and keep up the good work!
Thanks a lot and keep up the good work!
Remco NCrunch Developer
#765
19 Dec 2011 08:08 UTC
The fix for the above problem has now been released as part of 1.36b.
Post a reply
Log in to reply.