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
0 votes
In certain instances tests fail to run in Visual Studio 2005 when manipulating datasets after having installed Visual Studio 2008 on the same machine. Tests worked fine before Visual Studio 2008 was installed. The tests are done with MbUnit 2.4.197. I have tried experimenting with MbUnit 2.41.232 and Testdriven 2.10.2172, but it didn't make a difference.

What I get is the error "Common Language Runtime detected an invalid program". I have been trying different things and have found that uninstalling TypeMock fixes the issue and reinstalling TypeMock brings the issue back. Running the test in the MbUnit GUI always works fine, but with TestDriven.net in Visual Studio the error is thrown. TypeMock doesn't need to be used at all in the solution to produce the error. It is enough that TypeMock is installed.

This is on Vista X64. I have TypeMock with the x64 extra installed. TypeMock is v4.1.0.

The complete error:

Error 1 TestCase 'BrokenTest.CreateRowFilterFromViewTest' failed: Common Language Runtime detected an invalid program.
System.InvalidProgramException
Message: Common Language Runtime detected an invalid program.
Source: System.Data
StackTrace:
at System.Data.Index.GetEnumerator(Int32 startIndex)
at System.Data.DataView.ResetRowViewCache()
at System.Data.DataView.UpdateIndex(Boolean force, Boolean fireEvent)
at System.Data.DataView.UpdateIndex(Boolean force)
at System.Data.DataView.SetIndex2(String newSort, DataViewRowState newRowStates, IFilter newRowFilter, Boolean fireEvent)
at System.Data.DataView..ctor(DataTable table)
at BrokenTest.BrokenTest.CreateRowFilterFromViewTest() in C:\Users\halstein.MERCATUS0\Documents\Visual Studio 2005\Projects\BrokenTest\BrokenTest\BrokenTest.vb:line 16 C:\Users\halstein.MERCATUS0\Documents\Visual Studio 2005\Projects\BrokenTest\BrokenTest\BrokenTest.vb 16

The following code snippet demonstrates the error:


Imports MbUnit.Framework

<TestFixture()> _
Public Class BrokenTest

<Test()> _
Public Sub CreateRowFilterFromViewTest()
Dim dt As New DataTable
dt.TableName = "ScenarioUnit"
dt.Columns.Add("ScenarioUnitId")

Dim dr As DataRow = dt.NewRow
dr("ScenarioUnitId") = 1
dt.Rows.Add(dr)

Dim dv As DataView = New DataView(dt)
' .... crashes here so no more code included
End Sub

End Class
asked by halstein (8.7k points)

3 Answers

0 votes
Hi,

We have tried to reproduce your problem with no success yet.
However from your post we were not clear on several things:
In which IDE you are seeing the problem. Are you using the 2005 ide or the 2008?

Are you working with the 2008 release or the one of the previous beta version?

Does the failure happens all the times or only once in a while?

If possible please send us the logs of the failing run. I will mail you with instructions on how to produce the logs of the run.
answered by lior (13.2k points)
0 votes
The problem manifests itself both in VS2005 and VS2008. Uninstalling VS2008 and everything that came with it does not fix the problem for VS2005.

Before I install VS2008 everything worked fine. Having just VS2008 on a clean install of Vista Business x64 also produces the problem. Just VS2005 on a clean install works.

Does installing VS2008 maybe change/patch/update .Net 2.0?

I am working with VS2008 RTM.

The failure happens all the time on the exact same tests. Went from 0 failing of 442 tests to 67 failing tests.

I have sent you the logs as a reply to the mail you sent me.

I am currently installing VS2005 and VS2008 to a clean Windows XP virtual pc to try and replicate the problem there to see if this is Vista x64 only. During the weekend I did a clean install of Vista x64 on my computer with only VS2008, but the problem was still there.
answered by halstein (8.7k points)
0 votes
Hi,

Thank you for the detailed information.
Lets take this offline.
answered by lior (13.2k points)
...