Visual Studio 2015: Shared Project

Shared Project is one of the new features added to Visual Studio 2015. With Shared project, we can share our common code with many different type of applications like Console application, Windows app, Web application, Windows 8.1 app or Windows 8.1 Phone app, Silverlight and so on. Not only c# codes, we can share JavaScript, CSS and other kind of codes too.

There is another similar feature introduced in Visual Studio 2013, called Portable Class Library (PCL). Portable Library is also can be used by different project types. The main difference between these two kind of sharing options are:

  1. Shared Project share the code; whereas Portable Class Library share assembly(dll)
  2. Shared Project will not create any separate assembly; it will get compiled as part of the referring application. PCL compiles separately and add the dll reference to the referring project
  3. As shared projects are not precompiled, it can use with any kind of platform. PCL compiles in advance and won’t work with all platforms
  4. Shared Project share C# code as well as other types like JavaScript, CSS and so on.

Utilize the Shared Project in your solution to share the code and files among multiple projects. Create Shared Project using the “Shared Project” project template.

Advertisements

About ambilykk

I am a Technology Evangelist on Microsoft Technologies. I am carrying the passion on Microsoft technologies specifically on web technologies such as ASP .Net and Ajax. My interests also include Azure and Visual Studio. Technology adoption and learning is my key strength and technology sharing is my passion.
This entry was posted in Visual Studio 2015 and tagged . Bookmark the permalink.

4 Responses to Visual Studio 2015: Shared Project

  1. teevus76 says:

    Please elaborate on how you share javascript, css, and so on? I have added a javascript file to my Shared project, and referenced the shared project from my website project. When I build & run the website, the files are not copied across to the website, so how do you use them?

  2. teevus76 says:

    Please elaborate on how you share javascript, css, and so on? I have added a javascript file to my Shared project, and referenced the shared project from my website project. When I build & run the website, the files are not copied across to the website, so how do you use them?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s