hvanbakel / CsprojToVs2017

Tooling for converting pre 2017 project to the new Visual Studio 2017 format.
MIT License
1.08k stars 120 forks source link

Move the hidden *.cs (excluded files) from the project folder/subfolder to the backup folder #204

Closed moh-hassan closed 5 years ago

moh-hassan commented 6 years ago

In vs 2017 I can exclude CSharp file e.g class1.cs in the project from within the DropDown menu in the solution explorer by clicking the option 'Exclude from Project'.

Visual studio hide the file from the solution explorer and remove its entry(node) in cspro:.

         <Compile Include="Class1.cs" />  <!-- this node will be removed -->

and compilation and build are OK.

I can see these hidden files by pressing 'show all files' icon.

When I migrate the project, these hidden files become again part of the the project (although i excluded it, but not deleting it from the folder) and cause many problems(If i discover it :).

My work around is: Before migration 1) Click 'show all files' 2) Delete all the hidden cs files . 3) Migrate

It's nice if the migration tool can manage these hidden files in the old style project and move it to the backup folder with info message.

I lost hours to discover a problem in the project after migration and find the problem was the hidden files.

hvanbakel commented 6 years ago

What version did you use for this? This was reported in #190 which should be part of the latest version (3.0.2).

The only case in which it doesn't work is if you were using wildcards before.

moh-hassan commented 6 years ago

Thanks for reply. I use dotnet-migrate-2017.exe net461 v3.0.1 I will try using v3.0.2 and feedback. Note: The excluded files have no Compile Remove node:

       <Compile Remove="file.cs" />  <!-- not included in csproj -->
moh-hassan commented 6 years ago

The last release i found is 3.0.1

v3.0.2 is not includedin the release

hvanbakel commented 6 years ago

I just updated it, that's the only manual step in the release process so that's sometimes forgotten...

On Thu, Sep 20, 2018, 21:11 Mohamed Hassan notifications@github.com wrote:

The last release i found is 3.0.1

v3.0.2 is not includedin the release

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/hvanbakel/CsprojToVs2017/issues/204#issuecomment-423407780, or mute the thread https://github.com/notifications/unsubscribe-auth/AD8FPHBKMBjkilijusyiSxzfSaQLObFIks5udGcMgaJpZM4WxZS- .

moh-hassan commented 6 years ago

Great. :) v3.0.2 remove the hidden files. I find Compile Remove node in csproj for the hidden files.

These are the files which are removed:

    <ItemGroup>
        <Compile Remove="Class2.cs" />
        <Compile Remove="xyzclass.cs" />
        <Compile Remove="bin\Debug\aa.cs" />
        <Compile Remove="obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs" />
        <Compile Remove="obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs" />
        <Compile Remove="obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs" />
      </ItemGroup>

Just a suggestion:

Thanks for help and support

moh-hassan commented 5 years ago

Thank you :+1: