roslyn icon indicating copy to clipboard operation
roslyn copied to clipboard

Roslyn incorrectly report some API as `Not Available ⚠` in IntelliSense list for mulit targetframeworks projects

Open yyjdelete opened this issue 3 years ago • 0 comments

Version Used: VS2022 17.1.0 preview1.1

Steps to Reproduce:

  1. Create an new console app, and change it to multi target frameworks with net6.0;net472
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFrameworks>net6.0;net472</TargetFrameworks>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <LangVersion>latest</LangVersion>
  </PropertyGroup>

</Project>
  1. Try to autocomplete ProcessStartInfo with the below code
using System.Diagnostics;

Process.Start(new Pro { });//<--Try to autocomplete `ProcessStartInfo` here and see it in IntelliSense list

Expected Behavior: The API should be available for both target framework.

Actual Behavior: Roslyn report ProcessStartInfo is not avilable in net472 image

yyjdelete avatar Dec 24 '21 03:12 yyjdelete