Before reading this article please go through my previous article of the series:
This is part two of the series Visual Studio 2015 Features. In part 1, you learned about Custom Layout feature, like how can you manage different types of layout for different types of the system.
Today we are going to learn a very extensive and nice feature of Visual Studio 2015, Shared Project. As we all know, till know we can only share the library, assembly, services, etc. but there is not any option with previous Visual Studio to share the project itself.
But Visual Studio 2015 provides this feature and here you can create different kinds of project which is “Shared Project” and can share it with any type of project.
Shared Project is very useful when you are going to create some common functionality or shared logic which can be used with others application. It can be accessed by any type of application like Console Application, Windows Application, Phone application, etc.

Create Shared Project
To create a shared project, open Visual Studio 2015 and go to File menu and choose New and then choose Project. It will open a new Project dialog window, here from the Visual C# node, you can choose Shared Project from the right pane.
Specify the name of the project “MySharedProject" and click OK.

If you are using the Visual Studio 2015 with Windows 7 and it is your first time to setup Shared Project then you will get the following error,

To resolve this error you need to make some changes in the CodeSharing file of the Visual Studio 2015.
Go to the following location C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\CodeSharing and select the following file.

Open it with notepad and change the following line of code.
Find this code,
- <Import Project="$(MSBuildExtensionsPath32)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets')" />
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" Condition="!Exists('$(MSBuildExtensionsPath32)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets')" />
- <Import Project="$(MSBuildExtensionsPath32)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" Condition="false" />
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" Condition="true" />









Sibeesh VenuPosted Dec 26, 2015, 10:49 AM
Nice Share
Gowtham KPosted Dec 26, 2015, 9:16 AM
Good One
Raja TPosted Dec 26, 2015, 5:46 AM
Good, Thanks for sharing
Joe WilsonPosted Dec 26, 2015, 3:35 AM
Fine .