Having upgraded a large project from VS2008 to VS2013, a large number of unit tests are now failing because the associated data file cannot be found. The original DataSource attributes were created by the test connection string wizard that VS2008 provided, but this is no longer available in VS2013 Pro. The data files are definitely there, in exactly the same place in the solution, and all have the properties set to Copy Always. I suspect that the required arguments to the DataSource attribute have subtly changed but the MSDN documentation offers little help in this respect.
The error is:
Result Message: The unit test adapter failed to connect to the data source or to read the data. For more information on troubleshooting this error, see "Troubleshooting Data-Driven Unit Tests" (http://go.microsoft.com/fwlink/?LinkId=62412) in the MSDN Library. Error details: The Microsoft Jet database engine could not find the object 'MatrixSampleResultGrid_ExcludeHiddenResults.csv'. Make sure the object exists and that you spell its name and the path name correctly.
Previously this error has always been reported because the data file has been moved or renamed without the attribute being updated, but that is definitely not the case here.
This is a typical current DataSource attribute definition:
[DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", "|DataDirectory|\\MatrixSampleResultGrid_ExcludeHiddenResults.csv", "MatrixSampleResultGrid_ExcludeHiddenResults#csv", DataAccessMethod.Sequential)]
In the VS solution (ie on disk) the actual path to the datafile is
[theProjectRootFolder]\TestData\MatrixSampleResultGrid_ExcludeHiddenResults.csv
The test results are published to
[theProjectRootFolder]\TestResults\[testrun_datetimestamp]\In and ...\Out
although I notice that none of the data files have been copied to the In or Out folders. Is that significant?
With VS2008 these attributes have worked unchanged every day for years, so I can only conclude that for VS2013 the data is no longer appropriate, but what has changed? Without that wizard I can't even reconstruct the attribute so I am at a loss.
Also, I don't know what location "|DataDirectory|" represents in the context of a test run.
Can anyone help? TIA.