Are there any known issues when using Microsoft.VisualStudio.TestTools on “Windows Server 2019 Datacenter”

Martin Krischik 16 Reputation points
2021-07-09T10:44:15.07+00:00

We have a set of performance and stress test written with the Microsoft Visual Studio Test Tools and recently those test stopped working on all but one of our virtual machines.

The virtual machine where the test is still working is still using “Windows Server 2016 Datacenter” while the virtual machines which don't work any more have been updated to “Windows Server 2019 Datacenter”.

There is also a slight difference between the used Microsoft Visual Studio. The working system us using “Enterprise 2019 Version 16.7.3” while the system which don't work use the slightly newer “Enterprise 2019 Version 16.10.0”.

On the machines which don't work any more we get the following error:

Could not run Web test 'XXXXX' on agent 'XXXXXX': Could not access table 'Test#csv' in data source 'dsTest' of test 'XXXXXX,XXXXXX': The OleDbParameterCollection only accepts non-null OleDbParameter type objects, not SqlParameter objects.

And I was able to pinpoint the problem to the following statement:

c#
    using WebTesting = Microsoft.VisualStudio.TestTools.WebTesting;

    [WebTesting.DataSource (
        dataSourceName: "dsTest",
        providerName: "Microsoft.VisualStudio.TestTools.DataSource.CSV",
        connectionString: "|DataDirectory|\\data\\Test.csv",
        WebTesting.DataBindingAccessMethod.Sequential,
        WebTesting.DataBindingSelectColumns.SelectOnlyBoundColumns,
        tableName: "Test#csv")]

Are there any known problems when using Microsoft Visual Studio Test Tools on “Windows Server 2019 Datacenter” and/or “Microsoft Visual Studio Enterprise 2019 Version 16.7.3”?

And if so are there any fixes and workaround I could use?

Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
329 questions
Visual Studio Setup
Visual Studio Setup
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
968 questions
0 comments No comments
{count} vote

3 answers

Sort by: Most helpful
  1. Dejan Simeunovic 6 Reputation points
    2021-07-12T09:08:30.24+00:00

    I am getting the same or similar error when trying to debug the data-driven tests:

    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" (https://go.microsoft.com/fwlink/?LinkId=62412) in the MSDN Library.
    Error details: The OleDbParameterCollection only accepts non-null OleDbParameter type objects, not SqlParameter objects.

    In my case, this is the statement where the debugger fails to execute:
    [DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", @"|DataDirectory|\data\data.csv", "data#csv", DataAccessMethod.Sequential)]

    As soon as I remove the [DataSource] the test can be executed normally (without the data rows, of course).

    Since I am getting this error message on my local computer (not Windows Server), I would say it is rather an issue with the Visual Studio and "Microsoft.VisualStudio.TestTools.DataSource.CSV" provider after the last VS update...

    Still don't have the solution for it...

    1 person found this answer helpful.

  2. Reza-Ameri 16,831 Reputation points
    2021-07-11T17:29:59.813+00:00

    In general Visual Studio is supported on the Windows Server but it is not a known scenario (normally it is expected to run it on clients).
    You may report this as a bug in the Visual Studio , take a look at:
    https://learn.microsoft.com/en-us/visualstudio/ide/how-to-report-a-problem-with-visual-studio?view=vs-2019

    0 comments No comments

  3. Tore Olav Kristiansen 16 Reputation points
    2021-07-30T21:29:44.247+00:00

    As a workaround pending a fix from Microsoft to this VS2019 issue, the tests work in VS2017.

    0 comments No comments