简体   繁体   English

从 Visual Studio 解决方案中提取项目作为单独的项目

[英]Extracting a project as a separate project from the Visual Studio solution

I'm using Visual Studio 2013 and I have a solution that contains multiple projects.我正在使用 Visual Studio 2013 并且我有一个包含多个项目的解决方案。

I would like to extract one project from a solution to create a new, separate solution, that would only contain this one project.我想从解决方案中提取一个项目来创建一个新的、单独的解决方案,该解决方案只包含这个项目。

Does anyone know how to do this?有谁知道如何做到这一点?

If by "Extract", you mean "Duplicate" your project and start a new solution with this project, here is what you can do:如果“提取”是指“复制”您的项目并使用该项目开始一个新的解决方案,那么您可以执行以下操作:

  1. Create a new solution in Visual Studio在 Visual Studio 中创建新解决方案
  2. Copy your Project folder in the root of the new solution将您的项目文件夹复制到新解决方案的根目录中
  3. Right click on the solution => Add existing Project and select the project file (*.csproj in this case)右键单击解决方案 =>添加现有项目并选择项目文件(在本例中为 *.csproj)

Copy the project folder into separate folder, open the .csproj file, press CTRL + S , it will open the save dialog and you will save the .sln file.将项目文件夹复制到单独的文件夹中,打开 .csproj 文件,按CTRL + S ,它将打开保存对话框,您将保存.sln文件。 That is it.这就对了。

Right click on any project, then Exclude from Project .右键单击任何项​​目,然后从项目中排除 The excluded files will be in the project folder.排除的文件将位于项目文件夹中。 Move those files to another folder, in the way you want it.按照您想要的方式将这些文件移动到另一个文件夹。 Then you can create and add those files in new project by Add existing item然后您可以通过添加现有项目在新项目中创建和添加这些文件

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

相关问题 在 Visual Studio 中重命名项目/解决方案 - Renaming project / solution in Visual studio 如何在Web项目解决方案visual studio中的单独项目中部署app.config - How to deploy app.config in separate project within a web project solution visual studio 从Visual Studio中的解决方案文件夹创建项目模板 - Create Project template from solution folder in visual studio 将项目从OutSystems转换为C#Visual Studio解决方案 - Convert a project from OutSystems to C# Visual Studio solution 如何从Visual Studio中的项目解决方案中删除其他构建文件 - How to Delete Additional build files from the Project Solution in visual studio 如何从 Visual Studio Package 项目中获取当前的解决方案名称? - How to get the current solution name from a Visual Studio Package project? Visual Studio多项目解决方案问题 - Visual Studio Multi Project Solution Issue 2013年Visual Studio 2008项目解决方案 - Visual Studio 2008 Project in 2013 Solution Visual Studio 2010解决方案中不可用的项目 - Project Unavailable in Visual Studio 2010 Solution 将项目添加到Visual Studio解决方案时的问题 - Question when adding a project to a Visual Studio solution
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM