Summary: | dev-dotnet/dotnet-sdk-8.0.100-r2 missing testhost.exe | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Davyd McColl <davydm> |
Component: | Current packages | Assignee: | dotnet project <dotnet> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | davydm, xgqt |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://github.com/dotnet/source-build/issues/4099 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Davyd McColl
2024-02-05 14:23:47 UTC
Hello David! I can confirm those files are missing from source-built dotnet-sdk (both stable and unstable). But I have been running tests with source-built SDK successfully. Stracing the dotnet test call shows that only this DLL from lib64 is used: > /usr/lib64/dotnet-sdk-8.0/sdk/8.0.101/Extensions/Microsoft.TestPlatform.TestHostRuntimeProvider.dll I see that you are building for net462, so maybe that is the issue + the test framework that you use. I know for a fact this works with nunit and xunit under net8.0 runtime target. If you are building with nunit or xunit can you check if building for net6.0 and then net8.0 works? > -p:TargetFramework=net8.0 -p:TargetFrameworks=net8.0 Either way I do not yet know why testhost.exe might be missing from source-built. If I try to craft a net462 project on 8.0.1 source to reproduce this is what I get:
> Determining projects to restore...
> All projects are up-to-date for restore.
> Zzz -> /tmp/tmp.8axCGSKU.tmpsh/Zzz/bin/Debug/net462/Zzz.dll
> Test run for /tmp/tmp.8axCGSKU.tmpsh/Zzz/bin/Debug/net462/Zzz.dll (.NETFramework,Version=v4.6.2)
> Microsoft (R) Test Execution Command Line Tool Version 17.8.0 (x64)
> Copyright (c) Microsoft Corporation. All rights reserved.
>
> Starting test execution, please wait...
> A total of 1 test files matched the specified pattern.
> System.IO.FileNotFoundException: Could not find 'mono' host. Make sure that 'mono' is installed on the machine and is available in PATH environment variable.
> at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Helpers.DotnetHostHelper.GetMonoPath() in /var/notmp/portage/dev-dotnet/dotnet-sdk-8.0.101/work/dotnet-sdk-8.0.1/src/vstest/artifacts/source-build/self/src/src/Microsoft.TestPlatform.CoreUtilities/Helpers/DotnetHostHelper.cs:line 93
> at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DefaultTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo) in /var/notmp/portage/dev-dotnet/dotnet-sdk-8.0.101/work/dotnet-sdk-8.0.1/src/vstest/artifacts/source-build/self/src/src/Microsoft.TestPlatform.TestHostProvider/Hosting/DefaultTestHostManager.cs:line 217
> at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings) in /var/notmp/portage/dev-dotnet/dotnet-sdk-8.0.101/work/dotnet-sdk-8.0.1/src/vstest/artifacts/source-build/self/src/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs:line 226
> at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyExecutionManager.InitializeTestRun(TestRunCriteria testRunCriteria, IInternalTestRunEventsHandler eventHandler) in /var/notmp/portage/dev-dotnet/dotnet-sdk-8.0.101/work/dotnet-sdk-8.0.1/src/vstest/artifacts/source-build/self/src/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyExecutionManager.cs:line 182
>
> Test Run Aborted.
I dont think we should support this use case since net462 is from before .NET Core but upstream distributes it ... :/
(In reply to Maciej Barć from comment #2) > If I try to craft a net462 project on 8.0.1 source to reproduce this is what > I get: > > > Determining projects to restore... > > All projects are up-to-date for restore. > > Zzz -> /tmp/tmp.8axCGSKU.tmpsh/Zzz/bin/Debug/net462/Zzz.dll This also happens on binary 8.0.1 and binary 8.0., so it is really a test framework issue - it wants mono and mono wants testhost.exe. Hi, thanks for getting back to me (: You can easily build net462 targets with dotnet by providing dotnet the information as to where it should find an SDK api to compile against - which I do in NExpect (https://github.com/fluffynuts/NExpect/) and in other projects - check out https://github.com/fluffynuts/NExpect/blob/master/src/MonoForFramework.targets Note that this is _not_ "mono building" or "mono testing" - this is dotnet being instructed to find apis for system stuff in another location. The produced assebmlies aren't specifically linked to mono either. I've used this process to cross-build net5.0+ and net462 for some time now (: It 100% should be a supported workflow because, as I say, this isn't mono building the app - it's dotnet building the app and using mono assemblies for a reference for core runtime apis. You can take the produced assemblies and use 'em anywhere there's a net462-compatible host (so, .NET Framework 4.6.2+ on windows, or mono on linux or osx). In this same solution, I have a test host for netcore stuff (with a lot of cross-linking: most of what's in this library should work fine on net5.0+ or netfx - it doesn't matter). That project builds and tests just fine. The net462 one builds fine but only tests when using dotnet-sdk-bin packages. The missing testhost.exe, although it's just a wrapper around testhost.dll, is required. To reiterate: mono doesn't want anything - this is dotnet packaging failure. I could reproduce the same issue by breaking my dotnet-sdk-bin installations by deleting testhost.exe in each. |