dotnet / project-system

The .NET Project System for Visual Studio
MIT License
969 stars 387 forks source link

Class generation in nested namespaces swaps namespace order for generated directories #2105

Closed poke closed 7 years ago

poke commented 7 years ago

Hey, I’ve noticed the following issue with the class code generation in Visual Studio 2017 (15.1 26403.7) using the new .csproj format:

  1. Create a .NETStandard library project.

  2. Create some class inside the namespace Service.Internal (created directories accordingly). It should look like this:

    Project with a simple folder structure `Service.Internal.MyService`

  3. Reference a non-existent type in the class, and use the quick fix bulb to generate the type:

    Referencing a non-existent type, and generating that type using the quick fix bulb

  4. Observe the resulting folder structure:

    Created `Utility` class is in the folder `Internal.Services` instead of `Service.Internal`

Obviously, the Utility class should have been created next to the MyService file in the same folder. The rest of the process works correctly, especially the actual namespace for the Utility class is correct.

davkean commented 7 years ago

Thanks for the bug, this is a dupe of https://github.com/dotnet/project-system/issues/1760.