Comments (11)
Found it. We have been doing full rewrite of how we package the app in 17.7.0 to build via the common build system Arcade, and the testhost we shipped in testhost.x86 is running as x64. I can see it fail in the same callstack when loading the dll into a plain x64 .net 7 console app. Surprisingly this error message is not mentioning anything about wrong image format, which is unexpected to me.
dumpbin /headers S:\t\xunit13\bin\Debug\net7.0\testhost.x86.exe
Microsoft (R) COFF/PE Dumper Version 14.38.32919.0
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file S:\t\xunit13\bin\Debug\net7.0\testhost.x86.exe
PE signature found
File Type: EXECUTABLE IMAGE
FILE HEADER VALUES
8664 machine (x64)
7 number of sections
63747414 time date stamp Wed Nov 16 06:24:36 2022
0 file pointer to symbol table
0 number of symbols
F0 size of optional header
22 characteristics
Executable
Application can handle large (>2GB) addresses
from vstest.
Fixes are building, if tests pass I will backport to 17.7.x and we should release patch on Tuesday.
from vstest.
Can you really reproduce this with xunit? Because I can't
from vstest.
Thanks for the info, will try it.
from vstest.
Can you really reproduce this with xunit? Because I can't
Yes, I can still reproduce with an xUnit project.
I don't see it, do you have more output in that console?
<!-- file mstest78.csproj --> <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net7.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> <IsPackable>false</IsPackable> <IsTestProject>true</IsTestProject> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.0" /> <PackageReference Include="MSTest.TestAdapter" Version="2.2.10" /> <PackageReference Include="MSTest.TestFramework" Version="2.2.10" /> <PackageReference Include="coverlet.collector" Version="3.2.0" /> </ItemGroup> </Project>
As far as I can see, <PlatformTarget>x86</PlatformTarget>
is missing in the .csproj
to reproduce the behaviour.
from vstest.
vstest.console S:\t\mstest77\bin\x86\Debug\net7.0\mstest77.dll --diag:logs
Microsoft (R) Test Execution Command Line Tool Version 17.6.2-release-20230615-01 (x64)
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
Logging Vstest Diagnostics in file: S:\t\mstest77\logs\vstest.console_57264.diag
A total of 1 test files matched the specified pattern.
[MSTest][Discovery][S:\t\mstest77\bin\x86\Debug\net7.0\mstest77.dll] Failed to discover tests from assembly S:\t\mstest77\bin\x86\Debug\net7.0\mstest77.dll. Reason:Could not load file or assembly 'mstest77, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
No test is available in S:\t\mstest77\bin\x86\Debug\net7.0\mstest77.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
Additionally, path to test adapters can be specified using /TestAdapterPath command. Example /TestAdapterPath:.
from vstest.
I am having this issue in CI builds, using the MS hosted agents.
It's a multi-targeted NUnit project that also targets netcoreapp3.1.
I have installed the netcoreapp3.1 runtime in x86 using the dotnet-install script and run the test using
dotnet test Project -- RunConfiguration.TargetPlatform=x86
I end up with a You must install or update .NET to run this application
error message. Same for x64 works fine.
from vstest.
@smkanadl are you hitting this with just 17.7.0 or 17.6.3 as well? Because needing x86 runtime is a normal behavior of a .NET application that is built via any SDK (no matter if x64, x86 or arm64), and x86 runtime is not installed by default IIRC. You can check "C:\Program Files (x86)\dotnet\dotnet.exe" --info, and see if you have the runtime listed in your list of x86 runtimes.
from vstest.
@nohwnd I am hitting this with 17.7.0 only. My pipeline was working fine with 17.6.1 before. When I upgraded to 17.7.0 it stopped working. Going back to 17.6.3 fix the problems.
The matching x86 runtime was always installed. I also tried to install the full x86 SDK to get 17.7.0 working, but that didn't help either.
from vstest.
I don't see it, do you have more output in that console?
How I do it:
dotnet test -- RunConfiguration.TargetPlatform=x86
Determining projects to restore...
All projects are up-to-date for restore.
mstest78 -> S:\t\mstest78\bin\Debug\net7.0\mstest78.dll
Test run for S:\t\mstest78\bin\Debug\net7.0\mstest78.dll (.NETCoreApp,Version=v7.0)
Microsoft (R) Test Execution Command Line Tool Version 17.7.0-preview-23364-03+bc17bb9693cfc4778ded51aa0ab7f1065433f989 (x64)
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
Passed! - Failed: 0, Passed: 1, Skipped: 0, Total: 1, Duration: 15 ms - mstest78.dll (net7.0)
<!-- file mstest78.csproj -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="coverlet.collector" Version="3.2.0" />
</ItemGroup>
</Project>
S:\t\mstest78> dotnet --version
7.0.400
from vstest.
Fixed in 17.7.1 that is now released and we will be inserting into net7 and next servicing of VS.
cc @cvpoienaru
from vstest.
Related Issues (20)
- System.ArgumentException in Visual Studio when running tests from Test Explorer HOT 1
- WindowsHangDumper: Expected path of DumpMinitool does not match path in Microsoft.Testplatform HOT 2
- Broken relative paths in `docs`
- Vstest loads Dlls in system folder before the ones in the application folder HOT 11
- "No test sources found matching the given filter '**\*,!**\obj\**' " error message is shown after automated tests with Azure Test Cases HOT 2
- TestExecution encountered unexpected failures System.IO.FileNotFoundException: Could not load file or assembly 'System.Net.Http, Version=4.2.0.0 HOT 1
- vstest.console not able to load Microsoft.DiaSymReader during execution HOT 6
- Outdated version of Microsoft.Diagnostics.NETCore.Client creates always exception warnings in log files HOT 1
- Consider DisableAppDomains=true by default HOT 1
- TrxLogger throws on certain platforms
- "The library 'hostpolicy.dll' required to execute the application was not found" - Azure vstest HOT 15
- ITestLoggerWithParameters | ITestLogger async issue HOT 5
- VS 17.8 MS testhost.exe crashing on .NET 8 with Internal CLR error. (0x80131506) HOT 6
- The HTML report has visual glitches (stairs effect) with the .NET 8 SDK HOT 3
- Does Microsoft.CodeCoverage require any SKU of Visual Studio? HOT 10
- error TF298509 when running in Azure DevOps: HOT 2
- Testhost stays alive even though KeepAlive=false HOT 4
- System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1 when running a Test Adapter Visual Studio Extension on VS 17.7.x or above.
- Upgrade to .NET 9 SDK HOT 5
- TestCategory no longer works for VsTest HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vstest.