Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,8 @@ public virtual TestProcessStartInfo GetTestHostProcessStartInfo(

if (testHostPath.IsNullOrEmpty())
{
throw new TestPlatformException("Could not find testhost");
string message = string.Format(CultureInfo.CurrentCulture, Resources.CouldNotFindTesthost, sourcePath, sourceDirectory);
throw new TestPlatformException(message);
}

// We silently force x64 only if the target architecture is the default one and is not specified by user
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@
<data name="SuggestPublishTestProject" xml:space="preserve">
<value>Unable to find {0}. Please publish your test project and retry.</value>
</data>
<data name="CouldNotFindTesthost" xml:space="preserve">
<value>Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</value>
<comment>'{0}' is the path to the test source (DLL/EXE), '{1}' is the directory where testhost was searched.</comment>
</data>
<data name="NoDotnetMuxerFoundForArchitecture" xml:space="preserve">
<value>Could not find '{0}' host for the '{1}' architecture.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" original="../Resources.resx" target-language="cs">
<body>
<trans-unit id="CouldNotFindTesthost">
<source>Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</source>
<target state="new">Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</target>
<note>'{0}' is the path to the test source (DLL/EXE), '{1}' is the directory where testhost was searched.</note>
</trans-unit>
<trans-unit id="MultipleFileVersions">
<source>Multiple versions of same extension found. Selecting the highest version.
{0}</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" original="../Resources.resx" target-language="de">
<body>
<trans-unit id="CouldNotFindTesthost">
<source>Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</source>
<target state="new">Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</target>
<note>'{0}' is the path to the test source (DLL/EXE), '{1}' is the directory where testhost was searched.</note>
</trans-unit>
<trans-unit id="MultipleFileVersions">
<source>Multiple versions of same extension found. Selecting the highest version.
{0}</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" original="../Resources.resx" target-language="es">
<body>
<trans-unit id="CouldNotFindTesthost">
<source>Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</source>
<target state="new">Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</target>
<note>'{0}' is the path to the test source (DLL/EXE), '{1}' is the directory where testhost was searched.</note>
</trans-unit>
<trans-unit id="MultipleFileVersions">
<source>Multiple versions of same extension found. Selecting the highest version.
{0}</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" original="../Resources.resx" target-language="fr">
<body>
<trans-unit id="CouldNotFindTesthost">
<source>Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</source>
<target state="new">Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</target>
<note>'{0}' is the path to the test source (DLL/EXE), '{1}' is the directory where testhost was searched.</note>
</trans-unit>
<trans-unit id="MultipleFileVersions">
<source>Multiple versions of same extension found. Selecting the highest version.
{0}</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" original="../Resources.resx" target-language="it">
<body>
<trans-unit id="CouldNotFindTesthost">
<source>Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</source>
<target state="new">Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</target>
<note>'{0}' is the path to the test source (DLL/EXE), '{1}' is the directory where testhost was searched.</note>
</trans-unit>
<trans-unit id="MultipleFileVersions">
<source>Multiple versions of same extension found. Selecting the highest version.
{0}</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" original="../Resources.resx" target-language="ja">
<body>
<trans-unit id="CouldNotFindTesthost">
<source>Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</source>
<target state="new">Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</target>
<note>'{0}' is the path to the test source (DLL/EXE), '{1}' is the directory where testhost was searched.</note>
</trans-unit>
<trans-unit id="MultipleFileVersions">
<source>Multiple versions of same extension found. Selecting the highest version.
{0}</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" original="../Resources.resx" target-language="ko">
<body>
<trans-unit id="CouldNotFindTesthost">
<source>Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</source>
<target state="new">Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</target>
<note>'{0}' is the path to the test source (DLL/EXE), '{1}' is the directory where testhost was searched.</note>
</trans-unit>
<trans-unit id="MultipleFileVersions">
<source>Multiple versions of same extension found. Selecting the highest version.
{0}</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" original="../Resources.resx" target-language="pl">
<body>
<trans-unit id="CouldNotFindTesthost">
<source>Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</source>
<target state="new">Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</target>
<note>'{0}' is the path to the test source (DLL/EXE), '{1}' is the directory where testhost was searched.</note>
</trans-unit>
<trans-unit id="MultipleFileVersions">
<source>Multiple versions of same extension found. Selecting the highest version.
{0}</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" original="../Resources.resx" target-language="pt-BR">
<body>
<trans-unit id="CouldNotFindTesthost">
<source>Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</source>
<target state="new">Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</target>
<note>'{0}' is the path to the test source (DLL/EXE), '{1}' is the directory where testhost was searched.</note>
</trans-unit>
<trans-unit id="MultipleFileVersions">
<source>Multiple versions of same extension found. Selecting the highest version.
{0}</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" original="../Resources.resx" target-language="ru">
<body>
<trans-unit id="CouldNotFindTesthost">
<source>Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</source>
<target state="new">Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</target>
<note>'{0}' is the path to the test source (DLL/EXE), '{1}' is the directory where testhost was searched.</note>
</trans-unit>
<trans-unit id="MultipleFileVersions">
<source>Multiple versions of same extension found. Selecting the highest version.
{0}</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" original="../Resources.resx" target-language="tr">
<body>
<trans-unit id="CouldNotFindTesthost">
<source>Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</source>
<target state="new">Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</target>
<note>'{0}' is the path to the test source (DLL/EXE), '{1}' is the directory where testhost was searched.</note>
</trans-unit>
<trans-unit id="MultipleFileVersions">
<source>Multiple versions of same extension found. Selecting the highest version.
{0}</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" original="../Resources.resx" target-language="zh-Hans">
<body>
<trans-unit id="CouldNotFindTesthost">
<source>Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</source>
<target state="new">Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</target>
<note>'{0}' is the path to the test source (DLL/EXE), '{1}' is the directory where testhost was searched.</note>
</trans-unit>
<trans-unit id="MultipleFileVersions">
<source>Multiple versions of same extension found. Selecting the highest version.
{0}</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" original="../Resources.resx" target-language="zh-Hant">
<body>
<trans-unit id="CouldNotFindTesthost">
<source>Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</source>
<target state="new">Could not find testhost for test source '{0}'.

Verify that:
- The test project references the 'Microsoft.NET.Test.Sdk' NuGet package.
- The project has been built and the output is in '{1}'.
- The project's target framework matches the installed .NET runtime.
</target>
<note>'{0}' is the path to the test source (DLL/EXE), '{1}' is the directory where testhost was searched.</note>
</trans-unit>
<trans-unit id="MultipleFileVersions">
<source>Multiple versions of same extension found. Selecting the highest version.
{0}</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,23 @@ public void GetTestHostProcessStartInfoShouldThrowExceptionWhenDotnetIsNotInstal
Assert.ThrowsExactly<TestPlatformException>(action);
}

[TestMethod]
public void GetTestHostProcessStartInfoShouldIncludeSourcePathInExceptionMessageWhenTesthostNotFound()
{
var sourcePath = Path.Combine(_temp, "mytest.dll");
var sourceDirectory = Path.GetDirectoryName(sourcePath)!;

// Ensure no testhost.dll exists anywhere
_mockFileHelper.Setup(fh => fh.Exists(It.IsAny<string>())).Returns(false);

Action action = () => _dotnetHostManager.GetTestHostProcessStartInfo(new[] { sourcePath }, null, _defaultConnectionInfo);

var exception = Assert.ThrowsExactly<TestPlatformException>(action);
Assert.Contains(sourcePath, exception.Message);
Assert.Contains(sourceDirectory, exception.Message);
}


[TestMethod]
public void GetTestHostProcessStartInfoShouldIncludeSourceDirectoryAsWorkingDirectory()
{
Expand Down
Loading