Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An exception occurred while invoking executor 'executor://nodejstestexecutor/v1' #16173

Closed
limsbeheer opened this issue Apr 21, 2022 · 1 comment
Labels

Comments

@limsbeheer
Copy link

Required Information

Question, Bug, or Feature?
Bug

Enter Task Name: VsTest (Visual Studio Test)

Environment

  • Server - Azure Pipelines
  • Agent - Private, OS: Windows Server 2016 Standard, agent version: 2.181.2

Issue Description

We have a .NET 6 test project with both XUnit tests and Mocha tests. The Mocha tests are set up as described in https://docs.microsoft.com/en-us/visualstudio/javascript/unit-testing-javascript-with-visual-studio?view=vs-2022&tabs=mocha.
We get the error: An exception occurred while invoking executor 'executor://nodejstestexecutor/v1': Could not load file or assembly 'Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified when running the Mocha tests in VsTask using the Visual Studio Test Platform Installer (Test platform version = Installed by Tools Installer).
The Mocha tests run successful when using VsTask with a specific location for vstest.console.exe, namely the executable in the VS2022-folder (...\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe).

Troubleshooting

We are enable to reproduce the issue using the VS2022 Developer command prompt.
First using vstest.console from VS2022:

image

Using vstest.console gotten from task Visual Studio Test Platform installer:

image

Task logs

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
An exception occurred while invoking executor 'executor://nodejstestexecutor/v1': Could not load file or assembly 'Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Stack trace:
at Microsoft.NodejsTools.TestAdapter.ProjectTestDiscoverer.DiscoverTestsCore(IEnumerable`1 sources, IMessageLogger logger, ITestCaseDiscoverySink discoverySink)
at Microsoft.NodejsTools.TestAdapter.ProjectTestDiscoverer.DiscoverTests(IEnumerable`1 sources, IDiscoveryContext discoveryContext, IMessageLogger logger, ITestCaseDiscoverySink discoverySink)
at Microsoft.NodejsTools.TestAdapter.TestExecutorWorker.RunTests(IEnumerable`1 sources, ITestDiscoverer discoverer)
at Microsoft.NodejsTools.TestAdapter.ProjectTestExecutor.RunTests(IEnumerable`1 sources, IRunContext runContext, IFrameworkHandle frameworkHandle)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.RunTestsWithSources.InvokeExecutor(LazyExtension`2 executor, Tuple`2 executorUriExtensionTuple, RunContext runContext, IFrameworkHandle frameworkHandle)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.<>c__DisplayClass48_0.b__0()
at Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformThread.<>c__DisplayClass0_0.b__0()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.TestPlatform.PlatformAbstractions.PlatformThread.Run(Action action, PlatformApartmentState apartmentState, Boolean waitForCompletion)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.TryToRunInSTAThread(Action action, Boolean waitForCompletion)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.RunTestInternalWithExecutors(IEnumerable`1 executorUriExtensionMap, Int64 totalTests)

Test Run Failed.

@github-actions
Copy link

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant