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

Content Include .feature files in .csproj #1

Open
konarx opened this issue Mar 1, 2024 · 8 comments
Open

Content Include .feature files in .csproj #1

konarx opened this issue Mar 1, 2024 · 8 comments

Comments

@konarx
Copy link

konarx commented Mar 1, 2024

Related to Discussion #57:

Hello!
After Reqnroll migration, the following snippet introduced in the .csproj file:

  <ItemGroup>
    <Content Include="Features\*.feature"/>
  </ItemGroup>

When using SpecFlow it wasn't there. And if I remove it, the IDE can not identify .feature files, only the .feature.cs files.

I am using Rider with the latest build of the Rider.Reqnroll plugin.
Here is how it looks when having the above snippet in .csproj and how it should be looking even when remove it:
image
and this is how it actually looks when removing it:
image

@Socolin
Copy link
Collaborator

Socolin commented Mar 24, 2024

The plugin does not control what is shown here.

Rider is using the rules in the csproj (and the imported rules from from the Reqnroll nuget) to list this. If with specflow this is displayed and not with reqnroll then I would think the problem is in Reqnroll targets/properties rules.

@gasparnagy Do you know if there was there any change on that part on reqnroll and could you send me a link to where those files are in the reqnroll repository ?

@gasparnagy
Copy link
Contributor

@Socolin there was no change in the target/property structure, but the properties have been renamed.

I see such strange issues in VS, when the IDE is opened before the appropriate Reqnroll NuGet packages have been restored.

@konarx could you please try to make a "dotnet restore" and open Rider only after that?

@Socolin
Copy link
Collaborator

Socolin commented Apr 11, 2024

So on a project still using specflow I don't have any problem, so I think something either was not rename correctly in the plugin or something changed in the csproj. It'll need more investigation

@Socolin
Copy link
Collaborator

Socolin commented Apr 12, 2024

So I took a look more deeply and the problem is only with Reqnroll, when using Specflow Nuget it works, even without any plugin so there is a problem somewhere in the .props, but this is weird because when I add the following snippet to the csproj rider detect them in double, so my guess is that rider find the .props correctly

    <ItemGroup>
        <ReqnrollFeatureFiles Include="**/*.feature" />
    </ItemGroup>

image

And without the .feature are only visible with the Show All Files options

image

The files can be found there

image


I check the difference between both files (from SpecFlow and Reqnroll) and I was not able to find any meaningful difference, the only diff are on the _Reqnroll_TaskFolder with an updated version. (On this topic @gasparnagy I think this could be updated to net6.0, the folder seems to be available and netcoreapp3.1 is eol)

Also while I'm this file I think those line should be added (I did not have time to test this yet)

    <!-- FastUpToDateCheck for R# -->
    <!-- https://www.jetbrains.com/help/resharper/Building_Solution.html#supported-build-items -->
    <AvailableItemName Include="ReqnrollFeatureFiles"/>

@gasparnagy
Copy link
Contributor

@Socolin Yes, fixing the net3.1 stuff is in progress. (SpecFlow has the same, so I don't think it has relevance.)

Maybe we should ask help from the Rider team?

@Socolin
Copy link
Collaborator

Socolin commented Apr 12, 2024

@Socolin Yes, fixing the net3.1 stuff is in progress. (SpecFlow has the same, so I don't think it has relevance.)

Maybe we should ask help from the Rider team?

I did, and they told me we should build 2 projects (1 with specflow/reqnroll) with binlogs and try to find the differences.

@JohnYoungers
Copy link

JohnYoungers commented Apr 18, 2024

I don't think it's an issue with the plugin; if I have a project with the following dependencies and the Rider plugin enabled:

<PackageReference Include="Reqnroll" Version="1.0.1" />

I can see the *.feature files fine (as well as the *.feature.cs files). The moment I add this:

<PackageReference Include="Reqnroll.MsTest" Version="1.0.1"/>

The *.feature files vanish: this is true with the plugin enabled or disabled. This 4 year old issue pointed me in the direction of it potentially being package related: SpecFlowOSS/SpecFlow#1454.

The noted resolution from that issue of adding them via an <ItemGroup> node works, but I'd have to assume however this was resolved in specflow, could be resolved here as well

@teast
Copy link

teast commented May 23, 2024

I'm also experience this with Rider 2024.1.2 and Reqnroll plugin 2024.1.3.

One thing that I can add to the discussion is that with Reqnroll plugin + latest SpecFlow.NUnit (3.9.74 as of writing) Rider will present the feature file with the feature.cs file under it, that is as expected without adding anything to the csproj file.

I did try and go back in SpecFlow.NUnit versions and it was first at 3.3.57 that the *.feature.cs files started to be presented under their corresponding *.feature file. I'm not sure if this could be of any help in troubleshooting this..

Regards

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

No branches or pull requests

5 participants