列出解决方案的项目/程序集
我想列出解决方案中的程序集,但仅列出解决方案中的项目,而不仅仅是 AppDomain.CurrentDomain.GetAssemblies(); 返回的已加载程序集列表。
是否有一个类可以为我提供运行时解决方案信息?理想情况下,我正在寻找类似 Application.GetSolutionProjects(); 的东西
项目是VS2008/C#/.Net 3.5
谢谢
I want to list the assemblies in my solution, but only those which are projects in my solution rather than just a list of loaded assemblies as would be returned by AppDomain.CurrentDomain.GetAssemblies();
Is there a class that gives me run time solution information? Ideally I'm looking for something like Application.GetSolutionProjects();
Project is VS2008/C#/.Net 3.5
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该应用程序实际上与您的解决方案是分开的。您可以解析解决方案和项目 XML 以生成由您的解决方案创建的程序集列表。
我不确定您如何在运行时执行此操作,因为解决方案和项目文件通常不可用。您可以在编译时预先创建一个列表,然后使用一个方法读取它。或者,您可以在编译时将程序集转储到特定的子目录中,然后检查该目录以在运行时列出您的程序集。
The application is actually separate to your solution. You could parse the solution and project XMLs to generate a list of assemblies created by your solution.
I'm not sure how you'd do this at runtime as the solution and project files wouldn't generally be available. You could precreate a list at compile time, then have a method read it. Or you could dump your assemblies into a specific subdirectory at compile time, and just examine that directory to list your assemblies at runtime.
解决方案文件仅适用于VS,它不是.net框架的一部分,也不包含在项目中,即您可以有一个项目和包含该项目的多个解决方案,您想获取什么解决方案项目?但是,您可以解析特定的解决方案文件以获取解决方案中的所有项目
Solution file is just for VS, It's not a part of .net framework, and it not include in projects, i.e you can have one project and multiple solution which contains this project, you want fetch what solutions project? But, You can parse specific solution file to get all projects in the solution