什么是“杂项文件” DTE VS2010 解决方案内部?
继续我之前的问题: VS2010 DTE Addin:解决方案文件夹内的项目不是“项目” ” 我成功地在解决方案中找到了我的所有项目。然而,代码还发现了一个名为“Miscellaneous Files”的额外项目。它的 Kind 与解决方案文件夹和项目也不同,但是在 ProjectKinds 类中没有固定的常量类型(就这一点而言,没有一个用于“项目”要么...)
- 这个项目是什么?
- 我应该关心这个吗?
- 为什么没有更多的常量
ProjectKinds
?
Following up on my previous question:
VS2010 DTE Addin: project inside solution folder is not "Project"
I successfully found all my projects in the solution. However, the code also founds an extra item named "Miscellaneous Files". It's Kind
is different to the solution folders and the projects as well, but there are no more constant kinds fixed in the ProjectKinds
class (for that matter there isn't one for "Projects" either...)
- What is this item?
- Should I be concerned about this?
- Why are there no more constants in
ProjectKinds
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(2)
“杂项文件”节点用于包含与解决方案中当前项目内容无关的打开文件。例如,从 C:\Foo\MySolution\ 打开一个解决方案,然后从 C:\SomeOtherPath\MyFile.cs 打开一个“松散”文件,您会注意到它存储在“杂项文件”下。如果在这些文件打开时保存解决方案,则此信息将保留,一旦解决方案关闭,该信息将从“其他文件”中删除。
如果您希望在解决方案资源管理器中“查看”“杂项文件”的内容,您需要在“工具”>“工具”中启用它。选项>环境>文件>在解决方案资源管理器中显示其他文件
有关其他文件的更多信息,请访问 https://learn .microsoft.com/en-us/visualstudio/ide/reference/miscellaneous-files
这取决于您的工具(插件、宏)想要做什么。
您可以使用
EnvDTE.Constants.vsProjectKindMisc
来识别杂项文件项目。The "Miscellaneous Files" node is used to contain open files that are not associated with the current project contents within the solution. For example, open a solution from C:\Foo\MySolution\ then open a 'loose' file from C:\SomeOtherPath\MyFile.cs, you'll notice that it stored under "Miscellaneous files". This information is persisted if the solution is saved whilst these files are open, it is removed from "Miscellaneous files" once the solution is closed.
If you wish to "see" the contents of "Miscellaneous Files" in Solution Explorer you need to enable it in Tools > Options > Environment > Documents > Show miscellaneous files in Solution Explorer
See more about miscellaneous files at https://learn.microsoft.com/en-us/visualstudio/ide/reference/miscellaneous-files
It depends what your tooling (addin, macro) wants to do.
You can use
EnvDTE.Constants.vsProjectKindMisc
to identify miscellaneous files projects.也许经过一些重构,您修改了 TFS 下的项目名称并使用解决方案资源管理器重命名项目(即右键单击项目并单击重命名)
它与源代码管理资源管理器上的此项目名称不匹配。这样,您将在解决方案资源管理器中看到与 TFS 无关的“杂项文件”,杂项文件文件夹将文件表示为链接。当您打开解决方案时,此文件夹不是解决方案的一部分。以下是对我有用的方法:
使用解决方案资源管理器重命名项目(即右键单击
项目并单击重命名)。(*您之前已经完成过)
在源代码管理资源管理器中重命名项目文件夹。
在文本编辑器中打开解决方案的 .sln 文件,然后修复该文件
小路。 (将对“OldPrjName”的任何引用替换为
“新项目名称”)。
在 Visual Studio 中重新加载您的解决方案。
查找所有旧名称空间并将其替换为新项目名称。
完成。检查更改。
谢谢 daniel-congrove
perhaps after some refactoring,you have modified the name of the project under TFS and Rename the project using the Solution Explorer (i.e. right click the project and click rename)
which does not match this project name on source Control Explorer. in this way you will see "Miscellaneous Files" in the Solution Explorer that are not associated with TFS,The Miscellaneous Files folder represents the files as links.this folder is not part of a solution, when you open a solution. Here's what worked for me:
Rename the project using the Solution Explorer (i.e. right click the
project and click rename).(*you have done it before)
Rename the project folder in Source Control Explorer.
Open your solution's .sln file in a text editor, and fix the file
path. (Replace any references to "OldPrjName" with
"NewPrjName").
Reload your solution in Visual Studio.
Find and replace all the old namespaces with the new project name.
Done. Check in changes.
thanks daniel-congrove