Move code file under another file in project

前端 未结 1 935
余生分开走
余生分开走 2021-01-26 21:17

I want to move one code file under the group of another, related file, like here:

\"code

As

相关标签:
1条回答
  • 2021-01-26 21:32

    I found one way of doing this, but it is not user-friendly and needs to edit project file by hands. I'm not sure it will work in other versions of Visual Studio then mine (MS Visual Studio 2013)

    First, unload project (right-click on project, Unload Project).

    Then edit csproj file (right-click again, Edit *.csproj)

    In editor, replace:

    <Compile Include="SingleDocumentViewModel.Commands.cs">
    

    with

    <Compile Include="SingleDocumentViewModel.Commands.cs">
      <DependentUpon>SingleDocumentViewModel.cs</DependentUpon>
    </Compile>
    

    Then save edited file and load project again (right-click on it, Reload project).

    Now files are grouped:

    grouped files

    0 讨论(0)
提交回复
热议问题