简体   繁体   中英

visual studio — can't remove files from solution explorer

I have a file in my solution explorer that I no longer want. When I right click on it, I see an option to "exclude" it from the project. But that still leaves it in the solution explorer. I also see an option to "delete" it. But I don't want to do that. What I want to do is stop having my current project reference it all, but still leave it in existence on disk. How do I do that?

I've tried the edit menu with it selected. Same thing. I can exclude or delete, but can't remove.

Its location on disk is not in the directory tree underneath the project directory.

EDIT: Apparently it was on the disk twice, once in the directory and hidden, which is why I kept seeing it.

Make sure your app is not running otherwise the delete and exclude option will be inactive in the context menu.

"Exclude from project" is the right option for your situation. You still see it in the Solution Explorer because you probably have the option to see all files in the file system turned on. That doesn't mean that the file is part of the solution.

If you don't want to see it anymore, either move it to another folder outside of the solution folder or disable the option to see all files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM