When running a test in a project where Microsoft.NET.Test.Sdk has been upgraded from 16.2.0 to 16.3.0 you get the following error when attempting to run a test:
An exception occurred while invoking executor 'executor://mstestadapter/v2': Access to the path 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\TestResults\Deploy_xxxx 2019-10-16 15_17_33' is denied.
or similar (I have also seen the path reported as C:\WINDOWS\system32\TestResults\Deploy_xxxx)
I've attached a simple solution demonstrating the issue
The TestAdd test in UnitTestErrorTests will error
The TestAdd test in UnitTestOld will succeed.
Chris,
Thank you for the provided project and steps.
I was able to reproduce this issue locally. Please give us some time to research and fix it.
Meanwhile would you please try to start Visual Studio under "administrator" and check if tests are correctly executed.
HI Alex,
I’ve retested running Visual Studio as administrator and it works correctly.
Chris,
Thank you for checking that the test runner works if Visual Studio is started with administrator privileges.