如何在一个解决方案中在多个项目之间共享脚本?

时间:2023-01-16 16:52:41

In case the question wasn't clear. I have 3 MVC projects in one Solution. Every time I create a new project it adds the "Scripts" folder with all the .js files I'll ever need. I don't want to have this created every time for every application. Is there a way to reference scripts from a central folder in the solution so all applications/projects can share one common script folder with all the scripts common among them?

万一问题不清楚。我在一个解决方案中有3个MVC项目。每次我创建一个新项目,它都会添加“Scripts”文件夹,其中包含所有我需要的.js文件。我不希望每次都为每个应用创建这个。是否有一种方法可以从解决方案的中心文件夹中引用脚本,以便所有应用程序/项目可以共享一个通用脚本文件夹,其中包含所有常见的脚本?

Edit: Please explain the pros and cons of doing this if there are any...now I'm curious.

编辑:如果有的话,请解释一下这样做的利弊。现在我很好奇。

7 个解决方案

#1


101  

Here is what I would recommend:

以下是我的建议:

Right click the solution and create a New Solution Folder called Common Javascript Files (or whatever you feel like calling it.

右键单击解决方案并创建一个名为Common Javascript文件的新解决方案文件夹(或您想调用它的任何东西)。

如何在一个解决方案中在多个项目之间共享脚本?

如何在一个解决方案中在多个项目之间共享脚本?

Right click on the Solution, click Open Folder in Windows Explorer, or navigate there manually for other versions of Visual Studio :(

右键单击解决方案,单击Windows资源管理器中的Open文件夹,或者手动导航到Visual Studio的其他版本:(

如何在一个解决方案中在多个项目之间共享脚本?

In the solution directory, create a directory with the same name as the solution folder (solution folders do not normally match directories at the source code level but this will for sanity sake).

在解决方案目录中,创建一个与解决方案文件夹名称相同的目录(解决方案文件夹通常不匹配源代码级别的目录,但这将为明智起见)。

如何在一个解决方案中在多个项目之间共享脚本?

In this new directory, add files that need to be shared between solutions.

在这个新目录中,添加需要在解决方案之间共享的文件。

如何在一个解决方案中在多个项目之间共享脚本?

In Visual Studio, click the solution folder and select Add - Existing Item.

在Visual Studio中,单击“解决方案”文件夹并选择“添加现有项目”。

如何在一个解决方案中在多个项目之间共享脚本?

In the file selection dialog, navigate to the directory previous created, select the file(s) added to the directory and click Add.

在“文件选择”对话框中,导航到先前创建的目录,选择添加到目录中的文件并单击“添加”。

如何在一个解决方案中在多个项目之间共享脚本?

如何在一个解决方案中在多个项目之间共享脚本?

In each Project that needs a shared file, right click on the project (or directory within the project) and click Add - Existing Item.

在每个需要共享文件的项目中,右键单击项目(或项目中的目录)并单击Add - Existing项。

如何在一个解决方案中在多个项目之间共享脚本?

Navigate to the shared Directory, Select the files and click the drop down arrow then click Add As Link.

导航到共享目录,选择文件并单击下拉箭头,然后单击Add As链接。

如何在一个解决方案中在多个项目之间共享脚本?

Now the files in the projects are essentially short cuts to the files in the Solution Folder. But they are treated as actual files in the project (this includes .CS or Visual Basic files, they will be compiled as files that actually exist in the project).

现在项目中的文件本质上是对解决方案文件夹中的文件的捷径。但是它们被视为项目中的实际文件(包括. cs或Visual Basic文件,它们将被编译为项目中实际存在的文件)。

如何在一个解决方案中在多个项目之间共享脚本?

PROS

优点

  • Files are truly shared across projects at Design time
  • 在设计时,文件在项目之间是真正共享的
  • Only the files needed for each project can be added, it's not all or nothing
  • 只能添加每个项目所需的文件,不是全部或没有
  • Does not require any configuration in IIS (virtual directory etc)
  • 不需要IIS中的任何配置(虚拟目录等)
  • If the solution is in TFS Source control, you can add the Directory to the TFS Source and the shared files will be source controlled.
  • 如果解决方案在TFS源控制中,您可以将目录添加到TFS源,共享文件将由源控制。
  • Editing a file by selecting it in the Project, will edit the actual file.
  • 通过在项目中选择一个文件进行编辑,将编辑实际的文件。
  • Deleting a Linked file does not delete the file.
  • 删除链接文件不会删除该文件。
  • This is not limited to JS files, linked files can be ANY file you might need (Images, Css, Xml, CS, CSHTML, etc)
  • 这不仅限于JS文件,链接文件可以是您可能需要的任何文件(图像、Css、Xml、CS、CSHTML等)

CONS

缺点

  • Each deployment gets it's own file.
  • 每个部署都有自己的文件。
  • There is a small learning curve when understanding that Solution Folders are not Directories that exist in a Solution Directory.
  • 当理解解决方案文件夹不是存在于解决方案目录中的目录时,会有一个小小的学习曲线。

#2


20  

The best thing to do, imo, is to roll your own CDN... Basically just create another site in IIS and give it it's own binding, e.g. "http://cdn.somedomain.com"

在我看来,最好的办法是自己卷CDN……基本上就是在IIS中创建另一个站点,并赋予它自己的绑定,例如。“http://cdn.somedomain.com”

Then store all of your css/js/fonts/shared images etc on the CDN site and link to them from your other sites.

然后在CDN网站上存储你所有的css/js/字体/共享图片,并从其他站点链接到它们。

Doing so solves 2 problems,

这样做可以解决两个问题,

  1. All of your stuff is shared when it needs to be and you only have to manage 1 revision per file.
  2. 当需要时,您的所有内容都是共享的,您只需管理每个文件的一个修订。
  3. Your users browsers can cache them in 1 single location instead of downloading copies of your stuff for every site that uses them..
  4. 你的用户浏览器可以在一个单独的位置缓存它们,而不是为每个使用它们的网站下载你的东西。

I added this answer because I see a lot of people referrencing creating virtual directories. While that does indeed share the files, it creates multiple download paths for them which is an extreme waste of bandwidth. Why make your users download jquery.js (1 * number of sites) when you can allow them to download it once on (cdn.somedomain.com).

我添加这个答案是因为我看到很多人在创建虚拟目录。虽然这确实共享文件,但它为它们创建了多个下载路径,这是对带宽的极大浪费。为什么要让用户下载jquery。当你允许他们下载一次的时候(cdn.somedomain.com)。

Also when I say waste of bandwidth, I'm not just talking about server bandwidth, I'm talking about mobile users on data plans... As an example, I hit our companies HR site (insuance etc) on my phone the other day and it consumed 250mb right out the gate, downloaded jquery and a bunch of stuff 5 times each... On a 2gb a month data plan, websites that do that really annoy me.

另外,当我说浪费带宽时,我指的不仅仅是服务器带宽,我指的是数据计划上的移动用户……举个例子,前几天我用手机访问了我们公司的人力资源网站(insuance等),结果它一下子就消耗了250mb的内存,下载了jquery等很多东西,每次下载5次……在一个每月2gb的数据计划中,这样做的网站让我很不爽。

#3


10  

Here it goes, IMO the best and easiest solution, I spent a week trying to find best and easiest way which always had more cons than pros:

在我看来,这是最好、最简单的解决方案,我花了一周的时间试图找到最好、最简单的方法,它总是弊大于利:

Resources(DLL)
  Shared
    images
      image.png
    css
      shared.css
    scripts
      jquery.js


MvcApp1
  Images
  Content
  Shared <- We want to get files from above dll here
  ...

MvcApp2
  Images
  Content
  Shared <- We want to get files from above dll here
  ...

Add following to MvcApp1 -> Project -> MvcApp1 Properties -> Build events -> post build event:

MvcApp1 ->项目-> MvcApp1属性->构建事件->构建事件:

start xcopy "$(SolutionDir)Resources\Shared\*" "$(SolutionDir)MvcApp1\Shared" /r /s /i /y

Here is explanation on what it does: Including Build action content files directory from referenced assembly at same level as bin directory

这里解释了它的作用:包括从与bin目录相同级别的引用程序集生成操作内容文件目录

Do the same for MvcApp2. Now after every build fresh static files will be copied to your app and you can access files like "~/Shared/css/site.css"

对MvcApp2执行相同的操作。现在,每次构建后,新的静态文件都会被复制到你的应用中,你可以访问像“~/Shared/css/site.css”这样的文件

If you want you can adjust the above command to copy scripts from .dll to scripts folder of every app, that way you could move some scripts to .dll without having to change any paths,here is example:

如果你想调整上面的命令,把脚本从。dll拷贝到每个应用的scripts文件夹,这样你就可以把一些脚本移到。dll而不用改变任何路径。

If you want to copy only scripts from Resources/Shared/scripts into MvcApp1/scripts after each build:

如果您希望在每次构建之后只将脚本从资源/共享/脚本复制到MvcApp1/脚本中:

start xcopy "$(SolutionDir)Resources\Shared\Scripts\*" "$(SolutionDir)MvcApp1\Scripts" /r /s /i /y

#4


2  

In IIS create a virtual folder pointing to the same scripts folder for each of the 3 applications. Then you'll only need to keep them in a single application. There are other alternatives, but it really depends on how your applications are structured.

在IIS中,为每个应用程序创建一个指向相同脚本文件夹的虚拟文件夹。然后只需要将它们保存在一个应用程序中。还有其他的选择,但这实际上取决于应用程序的结构。

Edit

编辑

A scarier idea is to use Areas. In a common area have a scripts directory with the scripts set to be compiled. Then serve them up yourself by getting them out of the dll. This might be a good idea if you foresee the common Area having more functionality later.

更可怕的想法是使用区域。在公共区域中,有一个脚本目录,其中设置了要编译的脚本。然后自己把它们从dll中取出来。如果您预见到公共区域稍后有更多的功能,这可能是一个好主意。

#5


2  

A suggestion that will allow you to debug your scripts without re-compiling the project:

一个建议,允许您在不重新编译项目的情况下调试您的脚本:

  • Pick one "master" project (which you will use for debugging) and add the physical files to it
  • 选择一个“主”项目(您将用于调试)并将物理文件添加到它。
  • Use "Add As Link" feature as described in Eric's answer to add the script files to the other projects in solution
  • 使用Eric的回答中描述的“作为链接添加”特性,将脚本文件添加到解决方案中的其他项目
  • Use CopyLinkedContentFiles task on Build, as suggested in Mac's comment to copy the files over to the second over to your additional projects
  • 在Build中使用CopyLinkedContentFiles任务,就像Mac的注释中建议的那样,将文件复制到第二个项目中

This way you can modify the scripts in the "master" project without restarting the debugger, which to me makes the world of difference.

通过这种方式,您可以修改“master”项目中的脚本,而无需重新启动调试器,这对我来说是非常重要的。

#6


1  

Most of the files that are included by default are also available via various CDN's.

默认情况下包含的大多数文件也可以通过各种CDN获得。

If you're not adding your own custom scripts, you may not even need a scripts directory.

如果不添加自定义脚本,甚至可能不需要脚本目录。

Microsoft's CDN for scripts: http://www.asp.net/ajaxlibrary/cdn.ashx

微软的CDN脚本:http://www.asp.net/ajaxlibrary/cdn.ashx

#7


1  

This is a late answer but Microsoft has added a project type called Shared Project starting Visual Studio 2013 Update 2 that can do exactly what you wan't without having to link files.

这是一个迟来的答案,但是微软已经添加了一个名为“共享项目启动Visual Studio 2013 Update 2”的项目类型,它可以在不需要链接文件的情况下完成你想做的事情。

The shared project reference shows up under the References node in the Solution Explorer, but the code and assets in the shared project are treated as if they were files linked into the main project.

共享项目引用显示在解决方案资源管理器的References节点下,但是共享项目中的代码和资产被视为链接到主项目的文件。

"In previous versions of Visual Studio, you could share source code between projects by Add -> Existing Item and then choosing to Link. But this was kind of clunky and each separate source file had to be selected individually. With the move to supporting multiple disparate platforms (iOS, Android, etc), they decided to make it easier to share source between projects by adding the concept of Shared Projects."

在以前的Visual Studio版本中,您可以通过添加->现有项目来共享项目之间的源代码,然后选择链接。但这有点笨拙,每个单独的源文件都必须单独选择。随着支持多种不同平台(iOS、Android等)的发展,他们决定通过增加共享项目的概念,使项目之间的资源共享更加容易。

https://blogs.msdn.microsoft.com/somasegar/2014/04/02/visual-studio-2013-update-2-rc-windows-phone-8-1-tools-shared-projects-and-universal-windows-apps/

https://blogs.msdn.microsoft.com/somasegar/2014/04/02/visual工作室- 2013更新- 2 rc - windows -电话- 8 - 1 -工具-共享-项目-和-通用- windows - apps/

Info from this thread:

从这个线程信息:

What is the difference between a Shared Project and a Class Library in Visual Studio 2015?

在Visual Studio 2015*享项目和类库的区别是什么?

https://*.com/a/30638495/3850405

https://*.com/a/30638495/3850405

#1


101  

Here is what I would recommend:

以下是我的建议:

Right click the solution and create a New Solution Folder called Common Javascript Files (or whatever you feel like calling it.

右键单击解决方案并创建一个名为Common Javascript文件的新解决方案文件夹(或您想调用它的任何东西)。

如何在一个解决方案中在多个项目之间共享脚本?

如何在一个解决方案中在多个项目之间共享脚本?

Right click on the Solution, click Open Folder in Windows Explorer, or navigate there manually for other versions of Visual Studio :(

右键单击解决方案,单击Windows资源管理器中的Open文件夹,或者手动导航到Visual Studio的其他版本:(

如何在一个解决方案中在多个项目之间共享脚本?

In the solution directory, create a directory with the same name as the solution folder (solution folders do not normally match directories at the source code level but this will for sanity sake).

在解决方案目录中,创建一个与解决方案文件夹名称相同的目录(解决方案文件夹通常不匹配源代码级别的目录,但这将为明智起见)。

如何在一个解决方案中在多个项目之间共享脚本?

In this new directory, add files that need to be shared between solutions.

在这个新目录中,添加需要在解决方案之间共享的文件。

如何在一个解决方案中在多个项目之间共享脚本?

In Visual Studio, click the solution folder and select Add - Existing Item.

在Visual Studio中,单击“解决方案”文件夹并选择“添加现有项目”。

如何在一个解决方案中在多个项目之间共享脚本?

In the file selection dialog, navigate to the directory previous created, select the file(s) added to the directory and click Add.

在“文件选择”对话框中,导航到先前创建的目录,选择添加到目录中的文件并单击“添加”。

如何在一个解决方案中在多个项目之间共享脚本?

如何在一个解决方案中在多个项目之间共享脚本?

In each Project that needs a shared file, right click on the project (or directory within the project) and click Add - Existing Item.

在每个需要共享文件的项目中,右键单击项目(或项目中的目录)并单击Add - Existing项。

如何在一个解决方案中在多个项目之间共享脚本?

Navigate to the shared Directory, Select the files and click the drop down arrow then click Add As Link.

导航到共享目录,选择文件并单击下拉箭头,然后单击Add As链接。

如何在一个解决方案中在多个项目之间共享脚本?

Now the files in the projects are essentially short cuts to the files in the Solution Folder. But they are treated as actual files in the project (this includes .CS or Visual Basic files, they will be compiled as files that actually exist in the project).

现在项目中的文件本质上是对解决方案文件夹中的文件的捷径。但是它们被视为项目中的实际文件(包括. cs或Visual Basic文件,它们将被编译为项目中实际存在的文件)。

如何在一个解决方案中在多个项目之间共享脚本?

PROS

优点

  • Files are truly shared across projects at Design time
  • 在设计时,文件在项目之间是真正共享的
  • Only the files needed for each project can be added, it's not all or nothing
  • 只能添加每个项目所需的文件,不是全部或没有
  • Does not require any configuration in IIS (virtual directory etc)
  • 不需要IIS中的任何配置(虚拟目录等)
  • If the solution is in TFS Source control, you can add the Directory to the TFS Source and the shared files will be source controlled.
  • 如果解决方案在TFS源控制中,您可以将目录添加到TFS源,共享文件将由源控制。
  • Editing a file by selecting it in the Project, will edit the actual file.
  • 通过在项目中选择一个文件进行编辑,将编辑实际的文件。
  • Deleting a Linked file does not delete the file.
  • 删除链接文件不会删除该文件。
  • This is not limited to JS files, linked files can be ANY file you might need (Images, Css, Xml, CS, CSHTML, etc)
  • 这不仅限于JS文件,链接文件可以是您可能需要的任何文件(图像、Css、Xml、CS、CSHTML等)

CONS

缺点

  • Each deployment gets it's own file.
  • 每个部署都有自己的文件。
  • There is a small learning curve when understanding that Solution Folders are not Directories that exist in a Solution Directory.
  • 当理解解决方案文件夹不是存在于解决方案目录中的目录时,会有一个小小的学习曲线。

#2


20  

The best thing to do, imo, is to roll your own CDN... Basically just create another site in IIS and give it it's own binding, e.g. "http://cdn.somedomain.com"

在我看来,最好的办法是自己卷CDN……基本上就是在IIS中创建另一个站点,并赋予它自己的绑定,例如。“http://cdn.somedomain.com”

Then store all of your css/js/fonts/shared images etc on the CDN site and link to them from your other sites.

然后在CDN网站上存储你所有的css/js/字体/共享图片,并从其他站点链接到它们。

Doing so solves 2 problems,

这样做可以解决两个问题,

  1. All of your stuff is shared when it needs to be and you only have to manage 1 revision per file.
  2. 当需要时,您的所有内容都是共享的,您只需管理每个文件的一个修订。
  3. Your users browsers can cache them in 1 single location instead of downloading copies of your stuff for every site that uses them..
  4. 你的用户浏览器可以在一个单独的位置缓存它们,而不是为每个使用它们的网站下载你的东西。

I added this answer because I see a lot of people referrencing creating virtual directories. While that does indeed share the files, it creates multiple download paths for them which is an extreme waste of bandwidth. Why make your users download jquery.js (1 * number of sites) when you can allow them to download it once on (cdn.somedomain.com).

我添加这个答案是因为我看到很多人在创建虚拟目录。虽然这确实共享文件,但它为它们创建了多个下载路径,这是对带宽的极大浪费。为什么要让用户下载jquery。当你允许他们下载一次的时候(cdn.somedomain.com)。

Also when I say waste of bandwidth, I'm not just talking about server bandwidth, I'm talking about mobile users on data plans... As an example, I hit our companies HR site (insuance etc) on my phone the other day and it consumed 250mb right out the gate, downloaded jquery and a bunch of stuff 5 times each... On a 2gb a month data plan, websites that do that really annoy me.

另外,当我说浪费带宽时,我指的不仅仅是服务器带宽,我指的是数据计划上的移动用户……举个例子,前几天我用手机访问了我们公司的人力资源网站(insuance等),结果它一下子就消耗了250mb的内存,下载了jquery等很多东西,每次下载5次……在一个每月2gb的数据计划中,这样做的网站让我很不爽。

#3


10  

Here it goes, IMO the best and easiest solution, I spent a week trying to find best and easiest way which always had more cons than pros:

在我看来,这是最好、最简单的解决方案,我花了一周的时间试图找到最好、最简单的方法,它总是弊大于利:

Resources(DLL)
  Shared
    images
      image.png
    css
      shared.css
    scripts
      jquery.js


MvcApp1
  Images
  Content
  Shared <- We want to get files from above dll here
  ...

MvcApp2
  Images
  Content
  Shared <- We want to get files from above dll here
  ...

Add following to MvcApp1 -> Project -> MvcApp1 Properties -> Build events -> post build event:

MvcApp1 ->项目-> MvcApp1属性->构建事件->构建事件:

start xcopy "$(SolutionDir)Resources\Shared\*" "$(SolutionDir)MvcApp1\Shared" /r /s /i /y

Here is explanation on what it does: Including Build action content files directory from referenced assembly at same level as bin directory

这里解释了它的作用:包括从与bin目录相同级别的引用程序集生成操作内容文件目录

Do the same for MvcApp2. Now after every build fresh static files will be copied to your app and you can access files like "~/Shared/css/site.css"

对MvcApp2执行相同的操作。现在,每次构建后,新的静态文件都会被复制到你的应用中,你可以访问像“~/Shared/css/site.css”这样的文件

If you want you can adjust the above command to copy scripts from .dll to scripts folder of every app, that way you could move some scripts to .dll without having to change any paths,here is example:

如果你想调整上面的命令,把脚本从。dll拷贝到每个应用的scripts文件夹,这样你就可以把一些脚本移到。dll而不用改变任何路径。

If you want to copy only scripts from Resources/Shared/scripts into MvcApp1/scripts after each build:

如果您希望在每次构建之后只将脚本从资源/共享/脚本复制到MvcApp1/脚本中:

start xcopy "$(SolutionDir)Resources\Shared\Scripts\*" "$(SolutionDir)MvcApp1\Scripts" /r /s /i /y

#4


2  

In IIS create a virtual folder pointing to the same scripts folder for each of the 3 applications. Then you'll only need to keep them in a single application. There are other alternatives, but it really depends on how your applications are structured.

在IIS中,为每个应用程序创建一个指向相同脚本文件夹的虚拟文件夹。然后只需要将它们保存在一个应用程序中。还有其他的选择,但这实际上取决于应用程序的结构。

Edit

编辑

A scarier idea is to use Areas. In a common area have a scripts directory with the scripts set to be compiled. Then serve them up yourself by getting them out of the dll. This might be a good idea if you foresee the common Area having more functionality later.

更可怕的想法是使用区域。在公共区域中,有一个脚本目录,其中设置了要编译的脚本。然后自己把它们从dll中取出来。如果您预见到公共区域稍后有更多的功能,这可能是一个好主意。

#5


2  

A suggestion that will allow you to debug your scripts without re-compiling the project:

一个建议,允许您在不重新编译项目的情况下调试您的脚本:

  • Pick one "master" project (which you will use for debugging) and add the physical files to it
  • 选择一个“主”项目(您将用于调试)并将物理文件添加到它。
  • Use "Add As Link" feature as described in Eric's answer to add the script files to the other projects in solution
  • 使用Eric的回答中描述的“作为链接添加”特性,将脚本文件添加到解决方案中的其他项目
  • Use CopyLinkedContentFiles task on Build, as suggested in Mac's comment to copy the files over to the second over to your additional projects
  • 在Build中使用CopyLinkedContentFiles任务,就像Mac的注释中建议的那样,将文件复制到第二个项目中

This way you can modify the scripts in the "master" project without restarting the debugger, which to me makes the world of difference.

通过这种方式,您可以修改“master”项目中的脚本,而无需重新启动调试器,这对我来说是非常重要的。

#6


1  

Most of the files that are included by default are also available via various CDN's.

默认情况下包含的大多数文件也可以通过各种CDN获得。

If you're not adding your own custom scripts, you may not even need a scripts directory.

如果不添加自定义脚本,甚至可能不需要脚本目录。

Microsoft's CDN for scripts: http://www.asp.net/ajaxlibrary/cdn.ashx

微软的CDN脚本:http://www.asp.net/ajaxlibrary/cdn.ashx

#7


1  

This is a late answer but Microsoft has added a project type called Shared Project starting Visual Studio 2013 Update 2 that can do exactly what you wan't without having to link files.

这是一个迟来的答案,但是微软已经添加了一个名为“共享项目启动Visual Studio 2013 Update 2”的项目类型,它可以在不需要链接文件的情况下完成你想做的事情。

The shared project reference shows up under the References node in the Solution Explorer, but the code and assets in the shared project are treated as if they were files linked into the main project.

共享项目引用显示在解决方案资源管理器的References节点下,但是共享项目中的代码和资产被视为链接到主项目的文件。

"In previous versions of Visual Studio, you could share source code between projects by Add -> Existing Item and then choosing to Link. But this was kind of clunky and each separate source file had to be selected individually. With the move to supporting multiple disparate platforms (iOS, Android, etc), they decided to make it easier to share source between projects by adding the concept of Shared Projects."

在以前的Visual Studio版本中,您可以通过添加->现有项目来共享项目之间的源代码,然后选择链接。但这有点笨拙,每个单独的源文件都必须单独选择。随着支持多种不同平台(iOS、Android等)的发展,他们决定通过增加共享项目的概念,使项目之间的资源共享更加容易。

https://blogs.msdn.microsoft.com/somasegar/2014/04/02/visual-studio-2013-update-2-rc-windows-phone-8-1-tools-shared-projects-and-universal-windows-apps/

https://blogs.msdn.microsoft.com/somasegar/2014/04/02/visual工作室- 2013更新- 2 rc - windows -电话- 8 - 1 -工具-共享-项目-和-通用- windows - apps/

Info from this thread:

从这个线程信息:

What is the difference between a Shared Project and a Class Library in Visual Studio 2015?

在Visual Studio 2015*享项目和类库的区别是什么?

https://*.com/a/30638495/3850405

https://*.com/a/30638495/3850405