列出解决方案的项目/程序集

发布于 2024-10-07 21:09:48 字数 217 浏览 0 评论 0原文

我想列出解决方案中的程序集,但仅列出解决方案中的项目,而不仅仅是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

↘紸啶 2024-10-14 21:09:48

该应用程序实际上与您的解决方案是分开的。您可以解析解决方案和项目 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.

2024-10-14 21:09:48

解决方案文件仅适用于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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文