Skip to content

[🐛 Bug]: selenium-manager.exe not found .NET Framework 4.7.2 #16221

@GoldenWH

Description

@GoldenWH

Description

I have a library written in C# which exists for backwards compatibility to old .NET test projects. In the Selenium Webdriver 4.35.0 I get a System.IO.FileNotFoundException: 'Selenium Manager binary 'selenium-manager.exe' was not found in the following paths:

  • E:\Source\Repos\SeleniumManagerBug\bin\Debug\net472-windows\selenium-manager.exe
  • E:\Source\Repos\SeleniumManagerBug\bin\Debug\net472-windows\runtimes\win\native\selenium-manager.exe'

I've done some testing and found that it only happens when all

  1. targetframework net472 (maybe other .net framework versions, I haven't tested that)
  2. when the test project is calling on a library, and the library is providing the selenium webdriver reference.
  3. is not using MSTest.SDK project style
  4. the test project csproj does not have the property Exe

Of course I tried adding Exe to the test csproj, but mstest projects are libraries, not exes. it could be affecting other people so I am reporting it.

Reproducible Code

<Project Sdk="Microsoft.NET.Sdk">
	<PropertyGroup>
		<!-- With this commented, selenium-manager.exe will not be created -->
        <!-- <OutputType>Exe</OutputType> -->
		<IsTestProject>true</IsTestProject>


	</PropertyGroup>
  <PropertyGroup>
    <TargetFrameworks>net472-windows</TargetFrameworks>
    <LangVersion>13</LangVersion>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <EnableMSTestRunner>true</EnableMSTestRunner>
    <TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
    <!--
      Displays error on console in addition to the log file. Note that this feature comes with a performance impact.
      For more information, visit https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-integration-dotnet-test#show-failure-per-test
      -->
    <TestingPlatformShowTestsFailure>true</TestingPlatformShowTestsFailure>
    <PlatformTarget>x86</PlatformTarget>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net472-windows|AnyCPU'">
    <Optimize>True</Optimize>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
    <PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="17.12.6" />
    <PackageReference Include="Microsoft.Testing.Extensions.TrxReport" Version="1.4.3" />
    <PackageReference Include="MSTest" Version="3.6.4" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\ClassLibrary1\ClassLibrary1.csproj" />
  </ItemGroup>

  <ItemGroup>
    <Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
  </ItemGroup>

</Project>

Debugging Logs

no stack trace, builds with no errors but no selenium-manager.exe in the build output.
I created https://github.com/GoldenWH/SeleniumManagerBug to reproduce it.

Test won't run but I think that's unrelated.

ℹ️ Last known working version: 4.34.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!C-dotnet.NET BindingsD-chromeI-defectSomething is not working as intendedI-regressionSomething was working but we "fixed" itOS-windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions