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
2
votes
1 answer

Why can not I choose a PCL Project in Xamarin Forms?

At the moment of creating a new project, only shared project and standard .NET come out. Before I could only choose shared project and PCL project.
2
votes
1 answer

WPF Accessing image path from shared project

I have a WPF application (Project A) in which i have a Resource Dictionary file Global.xaml. In this file i am refering The above line references the image from the below…
Venkat Ramanan
  • 217
  • 2
  • 8
2
votes
1 answer

VS2017 Can't add reference to shared project / shared projects empty

I just came across this scenario and thought I'd share it in case it saves you some time. I have a fairly large solution in VS2017 and have a shared project that contains some common code such as enums. I just tried to add my shared project to…
Richard Moore
  • 1,133
  • 17
  • 25
2
votes
1 answer

Newtonsoft.json serializing and deserializing base/inheirited where classes are from shared projects

So I have two classes like the ones below. They are both in the same namespace and in the same shared project. public class Person{ public string Name{get;set;} } public class EmployedPerson : Person{ public string JobTitle{get;set;} } When…
BillHaggerty
  • 6,157
  • 10
  • 35
  • 68
2
votes
1 answer

Is there a way to use shared projects (shproj) in Visual Studio Code?

Hi, Shared project seemed like a good idea to share code between .NET Core 2.0 web project and .NET 4.7 WinForms project. I have bunch of extensions inside as well as web api client code which is used by both projects. Everything works well in…
mariob
  • 593
  • 1
  • 6
  • 15
2
votes
1 answer

Referencing shared project within solution structure

I'm trying to resolve problem with referencing shared project within couple class libraries. Inside solution the references between projects are: Class library A -> SharedProject Class library B -> SharedProject Class library C ->…
Kazenga
  • 476
  • 1
  • 4
  • 15
2
votes
0 answers

Can't access System.IO in Shared Project

I'm currently using Xamarin to make some quick mobile application. However, I'm trying to use Shared Project in order to write some JSON data in a file in both Android and iOS. If I put my object serializing data and saving it inside of two distinct…
Pictar
  • 47
  • 9
2
votes
1 answer

WPF User Control in VS 2015 'Shared Project'

I'm trying to use a 'Shared Project' in Visual Studio 2015 to share some XAML user controls between WPF applications, but can't get it working. Is this supported? The only 'Build Actions' in the list for .xaml and .xaml.cs files in Shared Projects…
GoldieLocks
  • 845
  • 7
  • 22
2
votes
2 answers

Shared Project with RC update 2 for Visual Studio 2013

I recently installed the RC update 2 for Visual Studio 2013. When going through the template for a universal app I found a project *******.Shared which had an extension .shproj. When going through some material online what I found was it is - a…
codingpirate
  • 1,414
  • 1
  • 12
  • 20
1
vote
1 answer

Shared Project spilts WPF .xaml file into two files

In Visual Studio 2022, I can create a WPF form in my C# Project (Masterclass.Revit.2023) but when I copy or move it to my Shared Project within the same solution it splits the .xaml into two separate files and the window is no longer visible. What I…
1
vote
2 answers

How to Use 2 libraries (contain a Shared Class) in a Project?

i have a Shared Project (SharedProject1) with a Class Called myDataInfo.cs and 2 Libraries (Common.csproj and CustomControls.csproj) , this two libraries uses SharedProject1. now i am using this 2 libraries in a Project Called Test.csproj. now when…
Chibako
  • 47
  • 4
1
vote
1 answer

Visual Studio 2019, how to use Image located in Shared Project in WPF/XAML?

I have an image file in a shared project. It is the company logo. In the shared project it is in Resources/logo.png. Its Build Action is "Content". Copy to Output Directory is set to "Copy always" When I use the XAML editor, it appears. When I run…
zekim
  • 82
  • 4
1
vote
1 answer

Include all folder files in a shared project

One of the advantages of .NET Core project format is that the *.csproj file doesn't contain the list of files to be included in the project anymore, it just includes everything in that folder. But Shared Projects still have the old .NET Framework…
SzilardD
  • 1,611
  • 2
  • 22
  • 40
1
vote
1 answer

Preventing mobile projects from using certain .cs files in a Shared Project

I am making a mobile app. In my Solution I have a shared project. Some of the files I do not want to be used in my iOS or Android builds. My code looks something like this: #if __MOBILE__ #else using Azure.Storage.Blobs; using…
ashlar64
  • 1,054
  • 1
  • 9
  • 24
1
vote
1 answer

Where should most of my platform specific code be in MVVM? (Beside View)

I'm Using Uno-Platform with MVVMLight trying to structure my project. Should I put platform specific code inside ViewModel? or should it mostly be in Utils/Services?