Roslyn: Multi-targeting context is broken in 16.0 Preview 1

Created on 26 Nov 2018  路  7Comments  路  Source: dotnet/roslyn

Version Used:
Version 16.0.0 Preview 1.0 [28321.56.d16.0]

Steps to Reproduce:

  1. Create a new Console App (.NET Core) and replace contents with:
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFrameworks>net45;net46</TargetFrameworks>
  </PropertyGroup>

</Project>
  1. Reload project
  2. In Editor, attempt to change context from net45 -> net46 (or vice versa)
  3. Click in editor

Expected Behavior:
Context to be changed

Actual Behavior:
Context is flipped back to the previous context.

This is a regression from 15.9.

Area-IDE Bug Developer Community Regression

Most helpful comment

@jaredpar (and others) the PR is now out for this #32313. It'll probably be a few days before it's merged in just because it's a tricky thing to review.

All 7 comments

reported at DC 413200

@jasonmalinowski As part of this change, this line of code https://github.com/dotnet/roslyn/blob/master/src/VisualStudio/Core/Def/Implementation/LanguageService/AbstractLanguageService%602.IVsContainedLanguageFactory.cs#L50 needs to be changed to a IsNullOrEmpty. The hierarchy you are querying is the real one now with https://github.com/dotnet/project-system/pull/4419 and it a IWebFileCtxService service from the web team that returns "" from GetIntellisenseProjectName.

@davkean I don't mind changing that, but why are we seeing this now? Was a "if empty, convert to null" being done somewhere else?

(That check is at _least_ 4 years old, hence my surprise for the need now.)

I've already fixed this myself so don't worry about making the change.

The hierarchy that was previously being checked here was the "fake" one - which caused the GetItemContext to fail.

Do we have an ETA for when this will be fixed? This bug is preventing me from using Dev16 on a number of fixes.

@jaredpar (and others) the PR is now out for this #32313. It'll probably be a few days before it's merged in just because it's a tricky thing to review.

Closing, as this is now merged into Roslyn. @jaredpar the bits were inserted today for Preview 2, so you should see this in a new dogfood build in the next day or two.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

OndrejPetrzilka picture OndrejPetrzilka  路  3Comments

AdamSpeight2008 picture AdamSpeight2008  路  3Comments

DavidArno picture DavidArno  路  3Comments

glennblock picture glennblock  路  3Comments

NikChao picture NikChao  路  3Comments