too many files
It's too clutering.
I don't have this problem before I upgrade the project into .net 7. I have this problem now.
too many files
It's too clutering.
I don't have this problem before I upgrade the project into .net 7. I have this problem now.
A visual basic (or also C#) project includes everything below the project folder by default. If you want to manually specify which files to include in a project, you need to either exclude everything else by default in the project file or revert back to the old behavior:
Edit your vbproj and add the following lines (see the longer answer here)
<PropertyGroup>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<EnableDefaultNoneItems>false</EnableDefaultNoneItems>
<EnableDefaultContentItems>false</EnableDefaultContentItems>
<!-- Or all default includes -->
<EnableDefaultItems>false</EnableDefaultItems>
</PropertyGroup>
Generally, part of your problem seems to be that you have a project file a level to high up. Project files (vbproj in your case) should be where the source is, so in your case in (some of) the subfolders, like "My Project", and not one level above. That's where the solution file goes. To avoid problems, projects shouldn't be organized recursively.
The directory tree in the screenshot looks like a big mess to me. Several (obsolete?) bin folders, folders called "My Project", several versions of the same project... Clean up your directory structure first.
In the Visual Studio "Tools" menu, go to "Options", then select the "General" tab under "Projects & solutions". Then check the "Track Active Item in Solution Explorer" option. Restart Visual Studio and see whether it fixes the issue.
If that doesn't work, you can right-click the folder and "Exclude from project"; the folder will still be there but not in the Solution Explorer (you can show it by pressing "Show All Files").