c# - 创建可重用的项目和解决方案结构

标签 c# visual-studio visual-studio-2013

我正在为 Visual Studio 中的 .NET 应用程序准备所有基础结构,解决方案中包含大约 17 个项目。这包括全局枚举、公共(public)资源文件、接口(interface)、公共(public)异常等。我还没有到编写特定于应用程序本身的代码的地步。

此时我想卡住我的解决方案结构的图像并使其可重复使用。意思是,在我的下一个项目中,我想从我现在所在的结构开始。

如何使用 Visual Studio 做到这一点?是只使用 Windows 资源管理器复制结构更好,还是 T4 模板提供一种方法来执行此操作?或者 Visual Studio 有更简单的方法吗?我目前使用的是 Visual Studio 2013。

最佳答案

您可以创建自己的项目或解决方案模板。

Multi-project templates act as containers for two or more projects. When a project based on a multi-project template is created from the New Project dialog box, every project in the template is added to the solution.

from How to: Create Multi-Project Templates

Visual Studio project and item templates provide reusable stubs that give users some basic code and structure that they can use for their own purposes.

from Creating Visual Studio Templates

关于c# - 创建可重用的项目和解决方案结构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21105265/

相关文章:

c# - 为什么此 EF 更新插入逻辑会导致删除而不是更新?

visual-studio - Visual Studio 2017-插入最终换行符

c++ - 自动按下按钮?

c++ - 创建无边界的 DirectShow 窗口

c# - Visual Studio IIS HTTP 503 服务不可用

c# - 使用 DirectShow 库编辑和保存 mp3 文件

c# - 将 Datagridview 记录导出到 Excel

c# - 当我键入 "object"时,如何阻止 Visual Studio 插入 "new {"

visual-studio - Visual Studio 2010中是否存在用于调试当前项目的快捷键?

visual-studio - 在 Resharper 中跳出右括号的最佳做法是什么?