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

Switching configurations does not update the language service #2262

Closed
davkean opened this issue May 23, 2017 · 5 comments
Closed

Switching configurations does not update the language service #2262

davkean opened this issue May 23, 2017 · 5 comments
Assignees
Labels
Feature-Language-Service Populating the Roslyn workspace with references, source files, analyzers, etc Resolution-Duplicate The bug is a duplicate of another bug in this or another repo.
Milestone

Comments

@davkean
Copy link
Member

davkean commented May 23, 2017

  1. Create a new Console app (.NET Core)
  2. Edit ConsoleApp1.csproj and replace the contents with:
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp1.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Compile Remove="Program.cs" />
    <Compile Include="Program.cs" Condition="'$(Configuration)' == 'Release'" />
  </ItemGroup>
</Project>
  1. Save
  2. Change Configurations from Debug -> Release
  3. Open Program.cs

Expected: For the file to be in the project
Actual: File is in misc project.

@davkean
Copy link
Member Author

davkean commented May 23, 2017

Looks like this was regressed when we implemented cross-targeting support - basically we're no longer listening the "active" config subscription service.

@davkean davkean self-assigned this May 23, 2017
@davkean davkean added Bug Feature-Language-Service Populating the Roslyn workspace with references, source files, analyzers, etc labels May 23, 2017
@davkean davkean added this to the 15.3 milestone May 23, 2017
@davkean davkean modified the milestones: 15.6, 15.3 Jun 5, 2017
@Pilchie Pilchie modified the milestones: 15.5, 15.6 Oct 17, 2017
@Pilchie
Copy link
Member

Pilchie commented Dec 20, 2017

@davkean is this something that will fall out of your current work on configurations?

@davkean
Copy link
Member Author

davkean commented Dec 20, 2017

Yes.

@shyamnamboodiripad
Copy link
Contributor

@ManishJayaswal @Pilchie @davkean I think this is the issue that we were discussing offline. This impacts unit testing features (both source based discovery as well as live unit testing).

To summarize: For net core projects, changing the solution configuration (e.g. Debug -> Release) via the dropdown in VS is not causing notifications to our Roslyn incremental analyzers (i.e. AnalyzeDocument is not being called). If I then make a code change, the solution crawler calls AnalyzeDocument. However, the Roslyn workspace does not reflect the config change - for example, querying on AbstractProject for a project's output path returns the path based on the old config as opposed to the new one (i.e. path has ...\Debug... instead of ...\Release...).

Consequently, unit test objects in VS's test window end up pointing to the wrong path and execution of such tests ends up failing.

I see that the issue is in 15.6 - as we discussed offline it would be great if we could fix this in 15.6 😄

@Pilchie
Copy link
Member

Pilchie commented Jan 10, 2018

Resolving as duplicate of #2733

@Pilchie Pilchie closed this as completed Jan 10, 2018
@Pilchie Pilchie added the Resolution-Duplicate The bug is a duplicate of another bug in this or another repo. label Jan 10, 2018
@drewnoakes drewnoakes removed the Bug label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature-Language-Service Populating the Roslyn workspace with references, source files, analyzers, etc Resolution-Duplicate The bug is a duplicate of another bug in this or another repo.
Projects
None yet
Development

No branches or pull requests

4 participants