在Visual Studio 2015年共享项目和类库之间的区别是什么? [英] What is the difference between a Shared Project and a Class Library in Visual Studio 2015?

查看:802
本文介绍了在Visual Studio 2015年共享项目和类库之间的区别是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找的Visual Studio 2015年和共享项目的新功能提出了很多,但我不明白它是如何不同使用类库或便携式类库。任何人都可以解释一下吗?

I was looking at the new features for Visual Studio 2015 and Shared Project came up a lot but I don't understand how it is different to using a Class Library or a Portable Class Library. Can anyone explain?

编辑:共享项目在Visual Studio 2015年的一项新功能是不同的,以便携式类库。我明白什么是可移植类库是。我试图了解是怎样一个共享项目的不同,以一个类库。请参阅下面的链接。

Shared Project is a new feature in Visual Studio 2015 and is different to a Portable Class Library. I understand what a Portable Class Library is. What I'm trying to understand is how a Shared Project differs to a Class Library. See link below.

<一个href="http://www.c-sharpcorner.com/UploadFile/7ca517/shared-project-an-im$p$pssive-features-of-visual-studio-201/">http://www.c-sharpcorner.com/UploadFile/7ca517/shared-project-an-im$p$pssive-features-of-visual-studio-201/

推荐答案

共享项目和一类库之间的区别是,后者被编译和再利用的单位是装配

The difference between a shared project and a class library is that the latter is compiled and the unit of reuse is the assembly.

而同前,复用的单元是源$ C ​​$ c和共享code为合并到每一个引用共享项目组件

Whereas with the former, the unit of reuse is the source code, and the shared code is incorporated into each assembly that references the shared project.

当您要创建独立的组件,这非常有用针对的的具体的平台,但仍然有code,应共享。

This can be useful when you want to create separate assemblies that target specific platforms but still have code that should be shared.

请参阅这里也

See also here:

共享项目引用显示了在Solution Explorer中引用节点,但在共享项目中的code和资产视为他们的文件链接到主项目。

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.

在previous的Visual Studio 1 ,你可以共享源代码$ C $项目之间通过将C版本 - >现有项,然后选择要链接。但是,这是一种笨重,每个单独的源文件都必须单独选择。随着向支持多个不同的平台(IOS,安卓等),他们决定把通过添加共享项目的概念,它更容易的项目之间共享源。


In previous versions of Visual Studio1, you could shared 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 2015年实际上是一种新的功能,他们做了他们的首演<一href="http://blogs.msdn.com/b/somasegar/archive/2014/04/02/visual-studio-2013-update-2-rc-universal-projects-for-windows-and-windows-phone.aspx"相对=nofollow>的Visual Studio 2013更新2

This question and my answer (up until now) suggest that Shared Projects were a new feature in Visual Studio 2015. In fact, they made their debut in Visual Studio 2013 Update 2

这篇关于在Visual Studio 2015年共享项目和类库之间的区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆