Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run dotnet build in linux container fails with "Could not find part of the path..." #2730

Open
GaTechThomas opened this issue Dec 8, 2023 · 0 comments
Labels

Comments

@GaTechThomas
Copy link

GaTechThomas commented Dec 8, 2023

SpecFlow Version

3.9.74

Which test runner are you using?

MSTest

Test Runner Version Number

3.1.1

.NET Implementation

.NET 6.0

Project Format of the SpecFlow project

Sdk-style project format

.feature.cs files are generated using

SpecFlow.Tools.MsBuild.Generation NuGet package

Test Execution Method

Command line – PLEASE SPECIFY THE FULL COMMAND LINE

SpecFlow Section in app.config or content of specflow.json

None.

Issue Description

Additional info: .NET8.0 project in devcontainer (image mcr.microsoft.com/devcontainers/dotnet:1-8.0-bookworm). Host OS is Windows 11. Devcontainer is run from WSL / vscode.

Running dotnet build in a linux container has the following error:

**/*.feature : error : System.IO.DirectoryNotFoundException: Could not find a part of the path '/workspaces/dapr-poc-cb1/functionaltests/**/*.feature'. [/workspaces/dapr-poc-cb1/functionaltests/functionaltests.csproj]

After much digging I was able to create a workaround:

Add the following section to the .csproj file:

  <ItemGroup>
    <SpecFlowFeatureFiles Remove="**\*.feature" />
    <SpecFlowFeatureFiles Include="*\*.feature" />

    <EmbeddedResource Remove="**\*.resx" />
    <EmbeddedResource Include="*\*.resx" />

    <Compile Remove="**\*.cs" />
    <Compile Include="*\*.cs" />
  </ItemGroup>

It seems that the globbing with two stars is failing to enumerate files, whereas the single star works.

Steps to Reproduce

Run dotnet build.

Link to Repro Project

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant