roslynator icon indicating copy to clipboard operation
roslynator copied to clipboard

ExtractTypeDeclarationToNewFile not work for multi targetFrameworks project

Open yyjdelete opened this issue 6 years ago • 0 comments
trafficstars

Product and Version Used: 2.2.0+VS2019 16.4.0Preview1

Steps to Reproduce:

  1. Create an csproj(ClassLibrary2) in VS, and modify to multi targetFrameworks
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFrameworks>netstandard2.0;net472</TargetFrameworks>
  </PropertyGroup>

</Project>
  1. Create Class1.cs at ClassLibrary2/NewFolder/Class1.cs;
  2. Add another class Class2 in the file;
namespace ClassLibrary2.NewFolder
{
    public class Class1
    {
    }
    public class Class2
    {
    }
}
  1. Call quick action at Class2, and choose Extract 'Class2' to a new file

Actual Behavior: Class2.cs should be created at ClassLibrary2/NewFolder/Class2.cs

Expected Behavior: Class2.cs be created at ClassLibrary2/ClassLibrary2 (netstandard2.0)/NewFolder/Class2.cs

yyjdelete avatar Oct 11 '19 04:10 yyjdelete