Giter Club home page Giter Club logo

Comments (11)

nohwnd avatar nohwnd commented on June 9, 2024 3

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.

nohwnd avatar nohwnd commented on June 9, 2024 2

Fixes are building, if tests pass I will backport to 17.7.x and we should release patch on Tuesday.

from vstest.

nohwnd avatar nohwnd commented on June 9, 2024 1

Can you really reproduce this with xunit? Because I can't

image

from vstest.

nohwnd avatar nohwnd commented on June 9, 2024 1

Thanks for the info, will try it.

from vstest.

norigeist avatar norigeist commented on June 9, 2024 1

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.

nohwnd avatar nohwnd commented on June 9, 2024

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.

smkanadl avatar smkanadl commented on June 9, 2024

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.

nohwnd avatar nohwnd commented on June 9, 2024

@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.

smkanadl avatar smkanadl commented on June 9, 2024

@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.

nohwnd avatar nohwnd commented on June 9, 2024

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.

nohwnd avatar nohwnd commented on June 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.