1

I have unit tests with 30 parameters which where working last year. Now VS (17.6.0 Preview 2) doesn't compile and fires (I precise again this code was running well with all these arguments last year):

Erreur CS1729 'DataRowAttribute' ne contient pas de constructeur qui accepte des arguments 30 [...]

( CS1729 'DataRowAttribute' does not contain a constructor that takes 30 arguments )

These tests are used to check multiple values for a single record (and I have many records to check).

What can I do ? Thanks, Vincent

Edit : .Net Framework 6 & MSTest.TestFramework 3.0.2

Edit2: As I can see in MS Test Framework, the constructor allow only 16 args now but I don't know why this regression and how handle it now.

EDit 3 : I was able to start my old computer running VS 17.5.2, MS Test Framework is 2.2.8 and all is OK. DataRowAttribute has this constructor line 59 : public DataRowAttribute (object data1, params object[] moreData) This constructor has been removed. So in my new computer I roll back to 2.2.10 and it works. So the regression is from 2.x to 3.x on packages MSTest.TestFramework & MSTest.TestAdapter

1 Answers1

0

As said in EDIT 3, it seems to be an issue with MSTest.TestFramework 3.x. So keep using MSTest.TestFramework 2.x

Here is the answer from Microsoft : "This is a known breaking change. The previous approach (up to 2.2.10) was allowing an "infinite" number of arguments but was causing an issue when trying to pass an array of objects as 2nd argument (see for example Cannot provide 2 arrays to DataRow · Issue #1180 · microsoft/testfx (github.com)). Based on our data, 16 arguments was a good compromise and matches what is done by runtime for their API."