|
17 | 17 | using System;
|
18 | 18 | using System.Collections.Generic;
|
19 | 19 | using System.Diagnostics;
|
| 20 | +using System.Globalization; |
20 | 21 | using System.IO;
|
21 | 22 | using System.Linq;
|
22 | 23 | using System.Net.NetworkInformation;
|
| 24 | +using System.Reflection; |
23 | 25 | using System.Runtime.InteropServices;
|
24 | 26 | using System.Text;
|
25 | 27 | using System.Threading;
|
|
30 | 32 | using Microsoft.VisualStudioTools;
|
31 | 33 | using Microsoft.VisualStudioTools.Project;
|
32 | 34 | using MSBuild = Microsoft.Build.Evaluation;
|
33 |
| -using System.Globalization; |
34 | 35 |
|
35 |
| -namespace Microsoft.NodejsTools.TestAdapter { |
| 36 | +namespace Microsoft.NodejsTools.TestAdapter |
| 37 | +{ |
36 | 38 | [ExtensionUri(TestExecutor.ExecutorUriString)]
|
37 | 39 | class TestExecutor : ITestExecutor {
|
38 | 40 | public const string ExecutorUriString = "executor://NodejsTestExecutor/v1";
|
@@ -158,6 +160,26 @@ private void RunTestCase(VisualStudioApp app, IFrameworkHandle frameworkHandle,
|
158 | 160 | return;
|
159 | 161 | }
|
160 | 162 |
|
| 163 | +#if DEV15 |
| 164 | + // VS 2017 doesn't install some assemblies to the GAC that are needed to work with the |
| 165 | + // debugger, and as the tests don't execute in the devenv.exe process, those assemblies |
| 166 | + // fail to load - so load them manually from PublicAssemblies. |
| 167 | + |
| 168 | + // Use the executable name, as this is only needed for the out of proc test execution |
| 169 | + // that may interact with the debugger (vstest.executionengine.x86.exe). |
| 170 | + string currentProc = Process.GetCurrentProcess().MainModule.FileName; |
| 171 | + if(Path.GetFileName(currentProc).ToLowerInvariant().Equals("vstest.executionengine.x86.exe")) |
| 172 | + { |
| 173 | + string baseDir = Path.GetDirectoryName(currentProc); |
| 174 | + string publicAssemblies = Path.Combine(baseDir, "..\\..\\..\\PublicAssemblies"); |
| 175 | + |
| 176 | + Assembly.LoadFrom(Path.Combine(publicAssemblies, "Microsoft.VisualStudio.OLE.Interop.dll")); |
| 177 | + Assembly.LoadFrom(Path.Combine(publicAssemblies, "envdte90.dll")); |
| 178 | + Assembly.LoadFrom(Path.Combine(publicAssemblies, "envdte80.dll")); |
| 179 | + Assembly.LoadFrom(Path.Combine(publicAssemblies, "envdte.dll")); |
| 180 | + } |
| 181 | +#endif |
| 182 | + |
161 | 183 | NodejsTestInfo testInfo = new NodejsTestInfo(test.FullyQualifiedName);
|
162 | 184 | List<string> args = new List<string>();
|
163 | 185 | int port = 0;
|
|
0 commit comments