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

Get shared project ".shproj" from a solution with Roslyn

I have a solution where I have a Shared Project of extension ".shproj" I need to add a class to the project with Roslyn, but when I look in the list of projects, It does not contain the shared project: const string solutionTargetPath =…
0
votes
1 answer

How to convert some functions for running in background? - Xamarin Forms

I'd like to know how can I convert this functions for running in the background (Running even if the app is closed or the phone was restarted) This is the code which I'd like to convert: private async void OnTimerElapsed(object sender,…
0
votes
0 answers

how to add new column in existing table in entity framework in xamarin shared project

I am using entity framework SQLite and I think it will use the concept of migration, as of now I have tried using create a new class library and creating the migration but I am always getting build failed error. I think I am not going through the…
0
votes
1 answer

How to localize .net shared projects

In Visual Studio you can create Shared Projects. Have Microsoft envisioned any standard approach to localization in a shared project? I'm pretty sure I can find a way to handle localization, but before I invent my own method, it would be nice to…
Phil Jollans
  • 3,605
  • 2
  • 37
  • 50
0
votes
1 answer

Visual Studio Successfully Using Shared Project wwwroot Files on Publish but not on Build/Run

The Background I'm working in Visual Studio 2019. I have a C# Web APP Razor Pages project which references several C# Class Projects and one C# Shared Project for files common across several other related Web App projects. The Problem When I publish…
Becca
  • 23
  • 9
0
votes
1 answer

How to add references and packages to a shproj or shared project in a visual studio solution?

I have a visual studio solution with a shared project and a number of projects that depend on it. The shared project is essentially the "bulk" of the entire solution, and the csprojs are basically "extensions" of the shared project. It looks…
Mechakhan
  • 25
  • 4
0
votes
1 answer

Visual Studio project is referencing a Shared project which has been deleted

I have a Visual Studio solution, containing multiple projects. To some of these projects, I had referenced a Shared Project, which has since been deleted. However, the Visual Studio project seems to still be referencing this deleted Shared…
D. Ondor
  • 79
  • 7
0
votes
1 answer

Xamarin Forms: Get the path of an image file stored on the shared project?

I am trying to upload an image file as ByteArrayContent through my web service. I have added all the images to the shared project and set the build action as Embedded resource. Following is my code: var fileBytes = File.ReadAllBytes("Avatars." +…
Sreejith Sree
  • 3,055
  • 4
  • 36
  • 105
0
votes
0 answers

IF condition for Xamarin.iOS and Xamarin.Android in Xamarin project

I am new to the Xamarin and trying to create Liveswitch project (https://help.frozenmountain.com/docs/liveswitch/release-notes) Project this : Liveswitch demo project have Xamrine project which had below structure: Shared project (it has…
ios developer
  • 3,363
  • 3
  • 51
  • 111
0
votes
1 answer

Why are PackageReference's references not working for msbuild and shared projects?

After migrating from packages.config to PackageReferences (.NET4.5 Project) the build (msbuild) is broken. error CS0246: The type or namespace name 'anynugetpackage' could not be found (are you missing a using directive or an assembly…
theBro
  • 66
  • 5
0
votes
2 answers

Shared Project option totally gone from the Xamarin.Forms project menu in Visual Studio 2019?

I work with Xamarin.Forms in Visual Studio since a few years, and updated my IDE recently (VS v. 16.3.7). Now I realized something is missing: the Shared Project option. When i go through the Wizard to create a new project the question if I want to…
deczaloth
  • 7,094
  • 4
  • 24
  • 59
0
votes
2 answers

Windows forms references and singleton with conflicted imported type

I have a solution with the following projects: Model: A shared project with the model App1: A windows forms application App2: Another windows forms application I'm trying to move some UserControl currently duplicated in both projects in a common…
gmazzotti
  • 427
  • 4
  • 11
0
votes
0 answers

Xamarin Forms and Prism to native view - Navigating from a view in prism project to a view in shared project

My Project: MyAppB (External Shared Project) includes multiple views (xaml files) which extends from ContentPage uses e.g. await Navigation.PushAsync(new Chat()); MyApplicationA (Code Sharing - .NET Standard 2.0) is build with prism framework…
Daniel0b1b
  • 2,271
  • 2
  • 11
  • 9
0
votes
2 answers

How to check Internet Connectivity in xamarin forms shared project

How can I check if Internet is available in Xamarin forms shared project. We can use Cross connectivity plugin in PCL project, can we use the same plugin in shared project as well?
Mars
  • 269
  • 1
  • 3
  • 22
0
votes
0 answers

Is it possible to share code between Xamarin.Forms projects?

My team has built a Xamarin.Forms application using VS2017. We are using a Shared project because one of our core functionalities requires ESRI mapping, and ArcGIS Runtime for Xamarin does not support anything but Shared projects at this time. The…