Skip to content

Commit 9f8f2f3

Browse files
committed
Add documentation about the different scenarios this plugin has to support in the relevant areas of code or build scripts to serve as a reminder in the future.
1 parent 8ba0539 commit 9f8f2f3

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

Source/Machine.VSTestAdapter/Helpers/IsolatedAppDomainExecutionScope.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ public T CreateInstance()
5353

5454
private static AppDomain CreateAppDomain(string assemblyPath, string appName)
5555
{
56-
// This is needed for the Visual Studio extension (.vsix), but not required for the nuget package, because
57-
// the nuget package is injecting msbuild to copy the test adapter bits into the build output.
56+
// This is needed in the following two scenarios, so that the target test dll and its dependencies are loaded correctly:
57+
//
58+
// 1. pre-.NET Standard (old) .csproj and Visual Studio IDE Test Explorer run
59+
// 2. vstest.console.exe run against .dll which is not in the build output folder (e.g. packaged build artifact)
60+
//
5861
CopyRequiredRuntimeDependencies(new[] {
5962
typeof(IsolatedAppDomainExecutionScope<>).Assembly,
6063
typeof(Mono.Cecil.MemberReference).Assembly,

Source/Machine.VSTestAdapter/Machine.Specifications.Runner.VisualStudio.props

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<!--
5+
The new dotnet tooling for the new .csproj format looks for test adapters in the build output directory
6+
and this msbuild script is ensuring we are copying everything needed.
7+
8+
It is ran automatically for us by simply being in the "build" folder in the nuget package.
9+
10+
MSBuildThisFileDirectory will be the full path to the relevant framework the build is running for.
11+
-->
312
<ItemGroup>
413

514
<!-- .NET Framework only -->

Source/Machine.VSTestAdapter/Machine.VSTestAdapter.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<PackagePath>build\$(_TargetDotNet)\</PackagePath>
7676
</Content>
7777

78-
<!-- .NET Framework - new .csproj -->
78+
<!-- .NET Framework - support for the new .csproj and dotnet test tooling -->
7979
<Content Include="Machine.Specifications.Runner.VisualStudio.props">
8080
<Pack>true</Pack>
8181
<PackagePath>build\$(_TargetDotNetFramework)\</PackagePath>
@@ -89,7 +89,7 @@
8989
<PackagePath>build\$(_TargetDotNetFramework)\</PackagePath>
9090
</Content>
9191

92-
<!-- .NET Framework - old .csproj -->
92+
<!-- .NET Framework - support for the old .csproj and vstest.console/IDE tooling -->
9393
<Content Include="bin\$(Configuration)\$(_TargetDotNetFramework)\*.dll">
9494
<Pack>true</Pack>
9595
<PackagePath>tools\</PackagePath>

0 commit comments

Comments
 (0)