deczaloth
deczaloth

Reputation: 7455

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 use Shared Project or PCL(or NetStandard) is now missing (see screenshot below from VS 2017)

Sharing strategy selection now missing

I do know that you can still create a Shared Project and add an iOS and an Android project manually, but this is just too cumbersome. My question really is: Is there a reason why Microsoft went on to push the PCL/NetStandard above the Shared Project strategy?


I am specially confused about this decision since already back in 2016 @miguel.de.icaza declared his favorite option (for most cases) was the Shared Project strategy:

https://tirania.org/blog/archive/2016/Jan-22.html

For me, the PCL is just too cumbersome for most uses. It is like using a canon to kill a fly. It imposes too many limitations (limited API surface), forces you to jump through hoops to achieve some very basic tasks.

Upvotes: 0

Views: 2149

Answers (2)

deczaloth
deczaloth

Reputation: 7455

Summarizing and adding to the answer by @WendyZang-MSFT:

I started a project using the Shared Project strategy around 4 years ago, and until now i have not found any issue/problem specific to it that would make me consider moving to .Net Standard.

Recently i went into the trouble of localization, and even that was possible using Shared Project without much hassle.

As mentioned above, after i saw that the latest version of Visual Studio 2019 was not offering the possibility of creating a Xamarin.Forms App as a Shared Project i got a bit worried thinking that i should migrate my solution. But the time hast passed by, and i just realized that MS encourages the use of .Net Standard, but Shared Project remains also a valid approach.

Upvotes: 1

Wendy Zang - MSFT
Wendy Zang - MSFT

Reputation: 10958

I have installed VS 2017 15.9.14, on this version, Portable Class Libraries (PCLs) are deprecated. You could use .NET Standard instead. On VS 2019, the default is .NET Standard.

enter image description here

On Microsoft document, MS recommend .NET Standard 2.0 libraries over Portable Class Libraries. For more, please refer to the MS docs. https://learn.microsoft.com/en-us/xamarin/cross-platform/app-fundamentals/code-sharing

My question really is: Is there a reason why Microsoft went on to push the PCL above the Shared Project strategy?

For MS announcement, PCL is deprecated, you could not find that when you create the project. You could create the Shared project by File > New > Project > Shared Project template.

For more details, you could check the link below. https://learn.microsoft.com/en-us/xamarin/cross-platform/app-fundamentals/shared-projects?tabs=windows

Updated:

Is there a reason why Microsoft went on to push the >NetStandard< above the Shared Project strategy?".

For the old version of VS 2017, .Net Standard is an option of Shared Project strategy.For the latest version of VS, MS use .Net Standard as the default for Sharing Strategy.

Is there any doc where MS states why Shared Project is now deprecated/not available in the Xamarin.Forms project wizard?

PCL is deprecated. Shared Project is still in use, in my answer, I provide the second link about how to create the shared project.

Upvotes: 2

Related Questions