简体   繁体   English

visual studio — 无法从解决方案资源管理器中删除文件

[英]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.如果您不想再看到它,请将其移动到解决方案文件夹之外的另一个文件夹或禁用查看所有文件的选项。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio解决方案资源管理器不允许我使用/查看新的.xaml文件 - Visual Studio Solution Explorer won't let me use / see new .xaml files 将MSBuild生成的文件添加到Visual Studio Solution Explorer - Adding MSBuild generated files to Visual Studio Solution Explorer 在Visual Studio解决方案资源管理器中将菜单项添加到.cs文件(仅)? - Add menu item to .cs files (only) in Visual Studio solution explorer? 在Visual Studio解决方案资源管理器中隐藏带有某些扩展名(dll)的文件 - Hide files with some extension (dll) in visual studio solution explorer Visual Studio不会刷新解决方案资源管理器文件夹中的新复制文件 - visual studio doesnt refresh new copied files in a folder of solution explorer 是否可以在Visual Studio 2013的解决方案资源管理器中手动标记文件 - Is it possible to manually flag files in the Solution Explorer in Visual Studio 2013 虽然我在解决方案资源管理器中有它们但不能使用文件夹[Visual Studio 2012] - Can't use folders although I have them in Solution Explorer [Visual Studio 2012] T4模板 - 在Visual Studio 2010中从一个应用程序域刷新解决方案资源管理器 - T4 templates - refreshing solution explorer in Visual Studio 2010 from one application domain to another Visual Studio 解决方案资源管理器未在解决方案中显示项目 - Visual Studio Solution Explorer not showing projects in solution Visual Studio在解决方案资源管理器中不显示来自目标的引用 - Visual Studio does not display references from targets in Solution Explorer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM