Bug 52932 - [XVS / Forms] Forms project and added Forms library have differing PCL Profiles
Summary: [XVS / Forms] Forms project and added Forms library have differing PCL Profiles
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Templates ()
Version: 4.3.0 (C9)
Hardware: PC Windows
: Normal normal
Target Milestone: 15.4
Assignee: Pierce Boggan [MSFT]
URL:
: 57506 58284 ()
Depends on:
Blocks:
 
Reported: 2017-03-01 17:04 UTC by Al Clark [MSFT]
Modified: 2017-11-30 19:01 UTC (History)
11 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Al Clark [MSFT] 2017-03-01 17:04:54 UTC

    
Comment 1 Al Clark [MSFT] 2017-03-01 17:27:13 UTC
=== Overview ===

Creating a Forms PCL project in VS targets Windows Phone Silverlight 8.  A subsequently added Forms library does _not_ target WPS 8. Unable to update due to dialogue box that indicates that projects should opt-into NuGet 3.0 support.  (We are using NuGet 3.5)

=== Steps to Reproduce ===

1. Create a new Forms PCL project (File > New > Project > Cross-Platform > Cross-Platform App)
2. Add Forms library (Right-click solution, Add > Project > Class Library (Xamarin.Forms)
3. Link library to PCL (Right-click PCL References > Add Reference... Select Forms library)

=== Expected Result ===

Reference to Forms library should be added to PCL project.

=== Actual Result ===

Error dialogue:
------
Unable to add a reference to project 'MyProject'. The targets of Portable Library project 'MyProject.Forms' are not the same or compatible with the targets of the current Portable Library project.

A Portable Library project's targets can be changed via the Library tab in the project's properties.
------

Attempting to change the targets results in the following error:
------
The project's targets cannot be changed. The selected targets require the project to opt-into NuGet 3.0 support, however, Visual Studio cannot automatically do this for you. Please uninstall all NuGet packages and try again.
------

Tested using NuGet 3.5.0.1484 and 3.5.0.1996

This does _NOT_ present in Xamarin Studio on Mac.

=== Workaround ===

From original customer reporting: "I solved this by closing VS, deleting all package.json files, deleting all packages, restarting VS, playing with the Library targets dialog until they all matched."

My full version info:

Microsoft Visual Studio Professional 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Professional

LightSwitch for Visual Studio 2015   00322-40000-00000-AA033
Microsoft LightSwitch for Visual Studio 2015

Visual Basic 2015   00322-40000-00000-AA033
Microsoft Visual Basic 2015

Visual C# 2015   00322-40000-00000-AA033
Microsoft Visual C# 2015

Visual C++ 2015   00322-40000-00000-AA033
Microsoft Visual C++ 2015

Visual F# 2015   00322-40000-00000-AA033
Microsoft Visual F# 2015

Windows Phone SDK 8.0 - ENU   00322-40000-00000-AA033
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   7.18.00214.2
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1   14.1.21111.0
ASP.NET and Web Tools 2015.1

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

Azure App Service Tools v2.9.6   14.0.21111.0
Azure App Service Tools v2.9.6

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.2.2100.0
Microsoft Azure Data Lake Tools for Visual Studio

Common Azure Tools   1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GitHub.VisualStudio   2.1.1.5
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

Merq   1.1.14-alpha (21c13c9)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft .NET Core Tools (Preview 2)   14.1.21111.0
Microsoft .NET Core Tools (Preview 2)

Microsoft Azure Hive Query Language Service   2.2.2100.0
Language service for Hive query

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.9.41104.6

Mono Debugging for Visual Studio   Mono.Debugging.VisualStudio
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   3.5.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

Python Tools for Visual Studio   2.2.40825.00
Python Tools for Visual Studio provides IntelliSense, projects, templates, Interactive windows, and other support for Python developers.

Python Tools for Visual Studio - Django Integration   2.2.40825.00
Provides templates and integration for the Django web framework.

Python Tools for Visual Studio - Profiling Support   2.2.40825.00
Profiling support for Python projects.

SQL Server Data Tools   14.0.60519.0
Microsoft SQL Server Data Tools

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript   1.8.36.0
TypeScript tools for Visual Studio

Visual Studio Tools for Universal Windows Apps   14.0.25527.01
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Xamarin   4.3.0.784 (73f58d6)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   7.1.0.41 (9578cdc)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   10.4.0.123 (35d1ccd)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 2 Karl Shifflett 2017-03-01 17:34:49 UTC
I have the same issue.
Comment 3 Pierce Boggan [MSFT] 2017-07-14 15:29:34 UTC
*** Bug 57506 has been marked as a duplicate of this bug. ***
Comment 5 Jimmy [MSFT] 2017-07-21 15:54:47 UTC
*** Bug 58284 has been marked as a duplicate of this bug. ***
Comment 7 Ketra 2017-11-29 18:05:00 UTC
I hit this problem trying to convert an existing Xamarin PCL project to .NET Platform Standard.  I'm using Nuget 3.4.4 so either the message is inaccurate, or there shouldn't be any error.
Comment 8 Pierce Boggan [MSFT] 2017-11-29 20:51:54 UTC
@Jay,

Thanks for the information! Can you list your reproduction steps? If you are attempting to migrate a Xamarin PCL project to .NET Standard, you wouldn't be using the template referenced in this issue. Could you also share your version information from Help -> About Microsoft Visual Studio -> Copy Information?

Thanks so much!
Comment 9 Karl Shifflett 2017-11-29 20:54:37 UTC
Pierce, it's because the templates provided by Microsoft have different profiles in them.

1.  Create a XF app using the PCL templates.

2.  Now try and add a XF PCL library to the project.

The project profiles will be different.  Real PIA.

.NET Standard gets rid of this issue.

Karl
Comment 10 Ketra 2017-11-29 21:12:51 UTC
Pierce,
I hit this by trying to modify the project properties of an existing xamarin.forms PCL project by clicking on 'Target .NET Platform Standard" on the Library tab, just underneath the Target Change button.  I thought that was the way to migrate to .NET Standard.  I tried getting rid of the packages.json files and deleting all packages but nothing got rid of that popup message.

I've since read the blog about how to do this here https://blog.xamarin.com/building-xamarin-forms-apps-net-standard/
 and started to try that.  So far, I haven't been able to select .NET Standard 2.0 for a new project - the option just isn't there even though I've installed VS 15.3 and the .NET Standard 2.0 runtime and SDK.  Still trying to sort this out.
Comment 11 Derek Foulk 2017-11-29 23:13:09 UTC
@Jay I use this method...

https://xamarinhelp.com/upgrade-pcl-net-standard-class-library/

It works, but you'll want to make note of your NuGet packages before converting the PCL (you will have to manually install them after- which isn't difficult).
Comment 12 Ketra 2017-11-30 16:20:45 UTC
Thanks for that pointer Derek.
Comment 13 Derek Foulk 2017-11-30 19:01:08 UTC
@Jay You're welcome! One more thing: When creating a new library for Xamarin.Forms; I found it easier to create a .NET Standard Class Library, then install Xamarin.Forms via NuGet (rather than create a Xamarin.Forms Class Library).

This way, you do not have to convert the PCL to .NET Standard.

Good luck man!