9.0.112 VSTest is busted on mono
When running a net462 test project with dotnet test on Linux (with full mono installed), I get the following error:
Cannot open assembly '/usr/lib/dotnet/sdk/9.0.112/Extensions/../TestHostNetFramework/testhost.exe': No such file or directory.
Testhost process for source(s) '/home/evangelink/test1/bin/Debug/net462/test1.exe' exited with error: Cannot open assembly '/usr/lib/dotnet/sdk/9.0.112/Extensions/../TestHostNetFramework/testhost.exe': No such file or directory.
Here is the content of the sdk folder:
AppHostTemplate
Containers
Current
DotnetTools
Extensions
FSharp
KnownWorkloadManifests.txt
MSBuild.deps.json
MSBuild.dll
MSBuild.runtimeconfig.json
Microsoft
Microsoft.ApplicationInsights.dll
Microsoft.AspNetCore.DeveloperCertificates.XPlat.dll
Microsoft.Build.Framework.dll
Microsoft.Build.NuGetSdkResolver.dll
Microsoft.Build.Tasks.Core.dll
Microsoft.Build.Utilities.Core.dll
Microsoft.Build.dll
Microsoft.CSharp.CrossTargeting.targets
Microsoft.CSharp.CurrentVersion.targets
Microsoft.CSharp.targets
Microsoft.Common.CrossTargeting.targets
Microsoft.Common.CurrentVersion.targets
Microsoft.Common.Test.targets
Microsoft.Common.overridetasks
Microsoft.Common.targets
Microsoft.Common.tasks
Microsoft.Deployment.DotNet.Releases.dll
Microsoft.DotNet.Cli.Sln.Internal.dll
Microsoft.DotNet.Cli.Utils.dll
Microsoft.DotNet.Configurer.dll
Microsoft.DotNet.InternalAbstractions.dll
Microsoft.DotNet.NativeWrapper.dll
Microsoft.DotNet.SdkResolver.dll
Microsoft.DotNet.TemplateLocator.dll
Microsoft.Extensions.Configuration.Abstractions.dll
Microsoft.Extensions.Configuration.Binder.dll
Microsoft.Extensions.Configuration.dll
Microsoft.Extensions.DependencyInjection.Abstractions.dll
Microsoft.Extensions.DependencyInjection.dll
Microsoft.Extensions.DependencyModel.dll
Microsoft.Extensions.FileProviders.Abstractions.dll
Microsoft.Extensions.FileSystemGlobbing.dll
Microsoft.Extensions.Logging.Abstractions.dll
Microsoft.Extensions.Logging.Configuration.dll
Microsoft.Extensions.Logging.Console.dll
Microsoft.Extensions.Logging.dll
Microsoft.Extensions.Options.ConfigurationExtensions.dll
Microsoft.Extensions.Options.dll
Microsoft.Extensions.Primitives.dll
Microsoft.Managed.After.targets
Microsoft.Managed.Before.targets
Microsoft.Managed.targets
Microsoft.NET.HostModel.dll
Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver.dll
Microsoft.NET.Sdk.WorkloadManifestReader.dll
Microsoft.NET.StringTools.dll
Microsoft.NET.props
Microsoft.NETCoreSdk.BundledCliTools.props
Microsoft.NETCoreSdk.BundledMSBuildInformation.props
Microsoft.NETCoreSdk.BundledVersions.props
Microsoft.NETFramework.CurrentVersion.props
Microsoft.NETFramework.CurrentVersion.targets
Microsoft.NETFramework.props
Microsoft.NETFramework.targets
Microsoft.TemplateEngine.Abstractions.dll
Microsoft.TemplateEngine.Cli.dll
Microsoft.TemplateEngine.Cli.xml
Microsoft.TemplateEngine.Core.Contracts.dll
Microsoft.TemplateEngine.Core.dll
Microsoft.TemplateEngine.Edge.dll
Microsoft.TemplateEngine.Orchestrator.RunnableProjects.dll
Microsoft.TemplateEngine.Utils.dll
Microsoft.TemplateSearch.Common.dll
Microsoft.TestPlatform.Build.dll
Microsoft.TestPlatform.CommunicationUtilities.dll
Microsoft.TestPlatform.CoreUtilities.dll
Microsoft.TestPlatform.CrossPlatEngine.dll
Microsoft.TestPlatform.PlatformAbstractions.dll
Microsoft.TestPlatform.Utilities.dll
Microsoft.TestPlatform.VsTestConsole.TranslationLayer.dll
Microsoft.TestPlatform.targets
Microsoft.VisualBasic.CrossTargeting.targets
Microsoft.VisualBasic.CurrentVersion.targets
Microsoft.VisualBasic.targets
Microsoft.VisualStudio.TestPlatform.Client.dll
Microsoft.VisualStudio.TestPlatform.Common.dll
Microsoft.VisualStudio.TestPlatform.ObjectModel.dll
Microsoft.VisualStudioVersion.v11.Common.props
Microsoft.VisualStudioVersion.v12.Common.props
Microsoft.VisualStudioVersion.v14.Common.props
Microsoft.Win32.Msi.dll
NETCoreSdkRuntimeIdentifierChain.txt
Newtonsoft.Json.dll
NuGet.Build.Tasks.Console.dll
NuGet.Build.Tasks.Console.runtimeconfig.json
NuGet.Build.Tasks.dll
NuGet.CommandLine.XPlat.deps.json
NuGet.CommandLine.XPlat.dll
NuGet.CommandLine.XPlat.runtimeconfig.json
NuGet.Commands.dll
NuGet.Common.dll
NuGet.Configuration.dll
NuGet.Credentials.dll
NuGet.DependencyResolver.Core.dll
NuGet.Frameworks.dll
NuGet.LibraryModel.dll
NuGet.Packaging.dll
NuGet.ProjectModel.dll
NuGet.Protocol.dll
NuGet.RestoreEx.targets
NuGet.Versioning.dll
NuGet.props
NuGet.targets
PortableRuntimeIdentifierGraph.json
Roslyn
RuntimeIdentifierGraph.json
SdkResolvers
Sdks
System.CodeDom.dll
System.CommandLine.dll
System.ComponentModel.Composition.dll
System.Configuration.ConfigurationManager.dll
System.Diagnostics.EventLog.dll
System.Formats.Nrbf.dll
System.Reflection.MetadataLoadContext.dll
System.Resources.Extensions.dll
System.Security.Cryptography.Pkcs.dll
System.Security.Cryptography.ProtectedData.dll
System.Security.Cryptography.Xml.dll
System.ServiceProcess.ServiceController.dll
cs
datacollector.deps.json
datacollector.dll
datacollector.dll.config
datacollector.runtimeconfig.json
de
dotnet.deps.json
dotnet.dll
dotnet.runtimeconfig.json
es
fr
it
ja
ko
minimumMSBuildVersion
pl
pt-BR
ref
ru
runtimes
sdk-check-config.json
testhost-1.0.runtimeconfig.json
testhost-1.1.runtimeconfig.json
testhost-2.0.runtimeconfig.json
testhost-2.1.runtimeconfig.json
testhost-3.0.runtimeconfig.json
testhost-3.1.runtimeconfig.json
testhost-5.0.runtimeconfig.json
testhost-6.0.runtimeconfig.json
testhost-7.0.runtimeconfig.json
testhost-8.0.runtimeconfig.json
testhost-9.0.runtimeconfig.json
testhost-latest.runtimeconfig.json
testhost.deps.json
testhost.dll
tr
trustedroots
vstest.console.deps.json
vstest.console.dll
vstest.console.dll.config
vstest.console.runtimeconfig.json
zh-Hans
zh-Hant
For reference, https://github.com/microsoft/vstest/issues/4657 suggests that this used to work.
I checked that TestHostNetFramework folder is included in the zip folders for linux that you can get from dot.net, but I can see that the folder is not included in my installation of 10.0.100 from apt get on ubuntu. Checking where the sources for that are.
Also mono is out of support already, is it not?
It's no longer supported by MS but it's still supported by WineHQ https://github.com/mono/mono
We should probably consider taking a breaking change and drop mono support.
Refer to the .NET SDK breaking change guidelines
While this still works on macOS (which isn't source-built), this stopped working on all Linux distributions that are source-built, when using the installers, a while ago. Probably 2-3 years by now. https://github.com/dotnet/source-build?tab=readme-ov-file#net-in-linux-distributions shows the full list of distros that have a source-built .NET SDK.
The set of customers that could still rely on this behavior are:
- Consumers of the Unix .tar.gz archive from dot.net that run
dotnet teston .NET Framework apps - MacOS users that run
dotnet teston .NET Framework apps.
I'm willing to make a statement that anyone who tests .NET Framework assemblies with the latest SDK on macOS or Unix also has a Windows verification test leg. There's not much sense in still testing .NET Framework assemblies on Unix with the latest .NET SDK. IMO making this breaking change on the vstest side based on that data should be easily justifiable.