Questions tagged [shared-project]

A Visual Studio 'Shared Project' allows code and assets to be shared amongst other projects.

Shared Project is a new project type that first appears in Visual Studio 2013 Update 2. The code (and assets) in a shared project are included in other projects at compile time.

This may be used as an alternative to Portable Class Libraries, such as when sharing code amongst projects which in their entirety are not cross-compatible.

For example, a solution which has multiple projects that build separate executables for alternative platforms (such as Android and iOS). The Shared Project may hold common code and assets that work on both platforms.

95 questions
3
votes
2 answers

Trying to better understand Shared Projects and using them in different solutions

Even though Shared Projects have been around since Visual Studio 2015 (maybe as early as VS 2013 update2), I've only recently learned about them. Today I spent time trying to learn how to use them following a tutorial I found Shared Project: An…
Rod
  • 4,107
  • 12
  • 57
  • 81
3
votes
0 answers

VS2017 multi project template with shared projects

I created a multi project template for use with VS2017, including a console application and two shared projects. I can see the template showing up, but whenever I try using it to create a new project I get an error stating that the "projitems"-file…
3
votes
1 answer

How to import M# IDE generated models to Zebble for Xamarin - Cross platform solution

I started developing a project with M#(4.8.333) IDE and now I have a Domain project which I need to add to Zebble solution Shared Project. How can I use this M# generated classes in Entities and DAL folder with Zebble mobile projects (UWP ,Android…
Iman
  • 17,932
  • 6
  • 80
  • 90
3
votes
1 answer

Xamarin read a file in shared Project

I'm trying to read a File in my Shared Project. var currentPath = Environment.CurrentDirectory; var filename = Path.Combine(currentPath, "File.txt"); var content = File.ReadAllText(filename); return content; If i…
Korken55
  • 233
  • 1
  • 3
  • 14
3
votes
1 answer

Add project reference to Xamarin.Forms

I need to add project reference of DTO to Xamarin.Forms project. But Path project doesn't have references. Problem in this: What should I do for this?
AlxZahar
  • 73
  • 9
3
votes
2 answers

CS0436 compiler warning with a shared project

We have two solutions (C#, VS2015) that consist of a few projects. The Basic-Solution with namespace Wpf has some classes that are re-written in the More Advanced - Solution in the namespace Wpf.Advanced because the more advanced solution uses…
Eru Iluvatar
  • 353
  • 1
  • 5
  • 17
3
votes
0 answers

Referencing string resources in VS2015 Shared Project from multiple WPF projects

I have a couple standard WPF projects (not UWP) that are both referencing a shared project using the new Visual Studio 2015 Shared Project type. This looks like it works great for sharing code, but I'd also like to share strings and other resources…
HotN
  • 4,216
  • 3
  • 40
  • 51
3
votes
0 answers

Copied Windows Phone 8.1 Project in new Windows 8.1 Universal Project

I am making a Windows 8.1 Universal app from an existing Windows Phone 8.1 App and an existing Windows 8.1 App. By copying the files and putting all the common files in the Shared folder correctly, the Universal.Windows app worked correctly. But the…
yalematta
  • 1,389
  • 1
  • 21
  • 36
3
votes
2 answers

Xamarin PCL vs. SL confusion

In Xamarin, I am confused on the exact difference between a PCL (portable class library) and a SL (shared library. I am working on a single, not worried about future other projects...so in developing a single code set and material UI based Xamarin…
3
votes
0 answers

The project 'projectname.Shared' cannot be added to the solution because it is already a member of the solution

Topic: Adding a shared (universal) library project to a DirectX+XAML Universal App in Visual Studio 2013 I have created a VS2013 Direct-X/XAML Universal App. Since it's a universal app, there are 3 projects: a project for Win 8.1 a project for Win…
user1884325
  • 2,530
  • 1
  • 30
  • 49
2
votes
1 answer

Uno Platform - Reference resource dictionary within Shared project

I'm building an Uno app and need to reference a Resource Dictionary defined and stored in the Shared Project. The project is set up like so: And in MainPage.xaml, I'm using:
Arlo
  • 963
  • 3
  • 11
  • 20
2
votes
1 answer

Set AndroidResource build action in Shared Project

I have lots of shared resources (layout, drawable, etc) in my Xamarin.Android projects. I want to have these shared resources in a centralized 'shared project'. (I cannot use Xamarin Library project type for some reason. 'Shared project' is my…
Fiona Bi
  • 3,140
  • 1
  • 9
  • 5
2
votes
0 answers

Add existing shared project, not added to source control

I have some shared projects which I use in a lot of other projects. My workflow for a new project is like this: Create blank VS solution (check "Add to Source Control" in the New Project dialog) Paste shared project folders into the solution…
Daniel Schmid
  • 362
  • 1
  • 5
  • 20
2
votes
0 answers

.net Shared Project how to access and use static files?

I added a shared project in my solution, I want to add partial views and static resources (css, images, JavaScript). How do I access them, what is the path for them? this is my…
Leth
  • 145
  • 1
  • 1
  • 12
2
votes
0 answers

C# / Xamarin constants in shared project

I'm creating a Xamarin shared project (but this could apply to C#/Visual Studio in general) that I'd like to reuse in more than one solution. Some of the classes use constant strings to define IDs and similar, for example: private readonly string…
G.Arna
  • 21
  • 2