mardi 16 mars 2021

Unable to find testhost.dll Please publish your test project and retry

I have created .net standard 2.1 class library project with specflow and selenium implementation. I have only added simple login tests in order to have POC that it is working. This is info from json file.

I've added Microsoft.NET.Test.Sdk package, that didn't solved my problem. I've added Microsoft.TestPlatform.TestHost, that didn't solved my problem either.

I'm a beginner so I'm not quite sure what else I need to post here in order to get some help which is more than welcome. I can provide additional info if needed, thanks in advance guys.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.1</TargetFramework>
    <OutputType>Library</OutputType>
  </PropertyGroup>

  <ItemGroup>
    <SpecFlowObsoleteCodeBehindFiles Remove="SharedFeatures\Login.feature.cs" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="BoDi" Version="1.5.0" />
    <PackageReference Include="Cucumber.Messages" Version="6.0.2" />
    <PackageReference Include="DotNetSeleniumExtras.WaitHelpers" Version="3.11.0" />
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.1" />
    <PackageReference Include="Microsoft.TestPlatform.TestHost" Version="16.9.1" />
    <PackageReference Include="NUnit" Version="3.13.1" />
    <PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
    <PackageReference Include="Selenium.Chrome.WebDriver" Version="85.0.0" />
    <PackageReference Include="Selenium.Support" Version="3.141.0" />
    <PackageReference Include="Selenium.WebDriver" Version="3.141.0" />
    <PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="89.0.4389.2300" />
    <PackageReference Include="SpecFlow" Version="3.7.38" />
    <PackageReference Include="SpecFlow.NUnit" Version="3.7.38" />
    <PackageReference Include="SpecFlow.Tools.MsBuild.Generation" Version="3.7.38" />
  </ItemGroup>

  <ItemGroup>
    <Compile Update="SharedFeatures\Login.feature.cs">
      <DependentUpon>%(Filename)</DependentUpon>
    </Compile>
  </ItemGroup>

  <ItemGroup>
    <SpecFlowFeatureFiles Update="SharedFeatures\Login.feature">
      <Visible>$(UsingMicrosoftNETSdk)</Visible>
      <CodeBehindFile>%(RelativeDir)%(Filename).feature$(DefaultLanguageSourceExtension)</CodeBehindFile>
    </SpecFlowFeatureFiles>
  </ItemGroup>

</Project>

This is the error I'm getting :

Unable to find C:PATH\bin\Debug\netstandard2.1\testhost.dll. Please publish your test project and retry.
Unable to find C:PATH\bin\Debug\netstandard2.1\testhost.dll. Please publish your test project and retry.

Aucun commentaire:

Enregistrer un commentaire