Skip to content

Go to Definition not working with non-default OutDir #122

@sponomarenkoMSFT

Description

@sponomarenkoMSFT

Used Visual Studio

Visual Studio 2022

Are the latest Visual Studio updates installed?

Yes

Content of reqnroll.json (if present)

No response

Issue Description

Issue Summary
The Reqnroll Visual Studio extension does not support Go To Definition functionality when the project uses a custom OutDir property pointing to a non-default location (e.g., an artifacts folder in the repository root).

Observed Behavior
In this scenario, the Reqnroll output window displays the following message:
Info: AndBindingSourceIsValid: Test assembly not found. Please build the project to enable the Reqnroll Visual Studio Extension features.

Root Cause
The extension appears to search for assemblies in the default path:
{project_location}\bin\$(Configuration)\$(TargetFramework)\$(AssemblyName)

When OutDir is set to a custom path, such as:
<OutDir>..\artifacts\bin\$(MSBuildProjectName)\$(Configuration)</OutDir>
the assemblies are no longer located in the expected directory. As a result, the extension cannot detect them, causing Go To Definition functionality to break.

Steps to Reproduce

  1. Create new Test project with simple feature and steps implementation
  2. Change build directory in .csproj file to something like <OutDir>..\artifacts\bin\$(MSBuildProjectName)\$(Configuration)\</OutDir>
  3. Build project
  4. Go to feature file and press F12

Expected behavior
Cursor moved to defined step in dedicated Bindings file

Actual behavior
Nothing happens

Notes

For clean results /bin folder must be cleaned up before steps of reproduction execution. Also after OutDir changes you need to restart VS as it is still caching path to steps and it will still navigate if you add OutDir. Only after VS restart and rebuild issue is reproducible.

Link to a project repository that reproduces the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions