This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 45249 - "Could not install package 'Xamarin.Forms 2.2.0.45'. You are trying to install this package into a project that targets 'Unsupported,Version=v0.0'" when adding a new XAML page to a Forms Shared Project
Summary: "Could not install package 'Xamarin.Forms 2.2.0.45'. You are trying to instal...
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Xamarin.Forms (show other bugs)
Version: 4.2.0 (C8)
Hardware: PC Windows
: High major
Target Milestone: 4.2.1 (C8SR1)
Assignee: Jose Gallardo
URL:
: 44386 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-10-10 20:01 UTC by Jon Goldberger
Modified: 2016-10-23 04:17 UTC (History)
8 users (show)

See Also:
Tags: BZRC8S1_C7SR1S1
Is this bug a regression?: Yes
Last known good build: Cycle 7 SR 1


Attachments

Description Jon Goldberger 2016-10-10 20:01:35 UTC
## Description

When adding a new XAML page to a new Forms Shared project, an error dialog is displayed with the following text:

>---------------------------
>Microsoft Visual Studio
>---------------------------
>Package Installation Error
>Could not add all required packages to the project. The following packages failed to install from 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\EXTENSIONS\IAEIO05K.AB5\Packages':Xamarin.Forms.2.2.0.45 : Could not install package 'Xamarin.Forms 2.2.0.45'. You are trying to install this package into a project that targets 'Unsupported,Version=v0.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
>---------------------------

However after this error dialog shows a couple of times, the page is added and appears to work as expected. Also although Forms version 2.2.0.45 is the version installed with the template, the error persists after updating Forms to version 2.3.2.127 for all projects in the solution. 

## Steps to reproduce

1. Open Visual Studio and create a new Xamarin Forms Shared Project

2. Right click on the Solution in the Solution Explorer and select "Manage Nuget Packages for Solution." 

3. Update Forms packages to version 2.3.2.127 for all projects in the solution

4. Right-click on the Forms Shared project in the Solution Explorer and select Add->New Item

5. Select a Forms Xaml Page from the template chooser and click "Add"

Expected result: A new Forms XAML Page will be added to the Shared project.

Actual result: Page is added but after the above error dialog is shown twice. 


## Notes

This error occurred whether adding a XAML Page, a XAML View, a C# page, or a C# view. 

## Environment

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

Installed Version: Enterprise

Architecture and Modeling Tools   00322-80000-00000-AA208
Microsoft Architecture and Modeling Tools
    
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

Microsoft Visual Studio Tools for Applications 2015   00322-80000-00000-AA208
Microsoft Visual Studio Tools for Applications 2015

Visual Basic 2015   00322-80000-00000-AA208
Microsoft Visual Basic 2015

Visual C# 2015   00322-80000-00000-AA208
Microsoft Visual C# 2015

Visual C++ 2015   00322-80000-00000-AA208
Microsoft Visual C++ 2015

Visual F# 2015   00322-80000-00000-AA208
Microsoft Visual F# 2015

Windows Phone SDK 8.0 - ENU   00322-80000-00000-AA208
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   7.8.00927.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1   14.1.20907.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.5   14.0.20810.0
Azure App Service Tools v2.9.5

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.1.0000.0
Microsoft Azure Data Lake Tools for Visual Studio

Command Bus, Event Stream and Async Manager   Merq
Provides ICommandBus, IEventStream and IAsyncManager MEF services for loosely coupled Visual Studio extension components communication and integration.

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

GitHub.VisualStudio   1.0
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

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

Microsoft Azure Hive Query Language Service   2.1.0000.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.40923.2

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.

SQL Server Analysis Services   13.0.1700.281
Microsoft SQL Server Analysis Services Designer 
Version 13.0.1700.281

SQL Server Data Tools   14.0.60923.0
Microsoft SQL Server Data Tools

SQL Server Integration Services   
Microsoft SQL Server Integration Services Designer
Version 13.0.1601.5

SQL Server Reporting Services   13.0.1700.281
Microsoft SQL Server Reporting Services Designers 
Version 13.0.1700.281

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.2.0.703 (3b7df6f)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   7.0.1.3 (96c7ba6)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   10.0.1.10 (ad1cd42)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 2 Jon Goldberger 2016-10-10 20:02:47 UTC
Additional note:

Same issue does _not_ occur in Xamarin Studio on a Mac.
Comment 3 Brendan Zagaeski 2016-10-10 20:16:04 UTC
Copying information from non-public Bug 44386 to consolidate information on this public bug:




## Regression status: regression in Cycle 8 compared to Cycle 7 SR 1

BAD:  XamarinVS 4.2.0.680 (c4382f5) Cycle 8
GOOD: XamarinVS 4.1.2.18  (fcbe082) Cycle 7 SR 1

(Note: The issue does not seem to depend on the contents of the template project since I tried using Cycle 8 template project in Cycle 7 SR 1, and it worked fine in Cycle 7 SR 1.)




## Steps followed to replicate

1. Create a new "Visual C# > Cross-Platform > Blank Xaml App (Xamarin.Forms Shared)" project.

2. Right-click the shared project in the solution explorer and select "Add > New Item".

3. Select "Visual C# > Cross-Platform > Forms Xaml Page".




## Results

The .xaml file is added to the project, but 2 error dialogs appear along the way as described in Comment 0:

> Package Installation Error


> Could not add all required packages to the project. The following
> packages failed to install from 'C:\PROGRAM FILES (X86)\MICROSOFT
> VISUAL STUDIO 14.0\COMMON7\IDE\EXTENSIONS\MNXY1GPZ.0C3\Packages':


> Xamarin.Forms.2.2.0.45 : Could not install package 'Xamarin.Forms
> 2.2.0.45'. You are trying to install this package into a project that
> targets 'Unsupported,Version=v0.0', but the package does not contain
> any assembly references or content files that are compatible with that
> framework. For more information, contact the package author.


- Building the app projects and then closing and reopening the solution does _not_ help stop the problem.

- The IDE logs files do not appear to contain any further details about the cause of the error, but they are attached in non-public Bug 44386, Comment 2 if needed.




## Additional environment info (brief)

Windows 10.0 (Build 10240)
Comment 4 Brendan Zagaeski 2016-10-10 20:17:18 UTC
*** Bug 44386 has been marked as a duplicate of this bug. ***
Comment 5 Jon Goldberger 2016-10-11 18:15:36 UTC
Customer who reported this issue to me reports that though the XAML page is created with the code behind xaml.cs file, the code behind file and the xaml page are at the same level in the hierarchy in solution explorer, rather than the code behind being a child of the xaml page as is expected. I could not reproduce that behavior on my end.
Comment 7 Parmendra Kumar 2016-10-17 14:23:21 UTC
I have checked this issue with latest C8SR1 and Master build and observed that this issue is working fine.

C8SR1: Xamarin.VisualStudio_4.2.1.10_7dfd88ce14299e8598bc95fe6fdbf14d68e96211
Master: Xamarin.VisualStudio_4.3.0.80_27f5b58cf1408ec9a0537e39b63246370ce54f74

Screencast: http://www.screencast.com/t/LPc5gdAG6

Hence closing this issue.
Comment 9 Prashant 2016-10-23 04:17:16 UTC
I am also getting same error with new Xamarin updates in VS-2015.
## Description
When adding a new XAML page to a new Forms Shared project, an error dialog is displayed with the following text:
>---------------------------
>Microsoft Visual Studio
>---------------------------
>Package Installation Error
>Could not add all required packages to the project. The following packages failed to install from 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\EXTENSIONS\IAEIO05K.AB5\Packages':Xamarin.Forms.2.2.0.45 : Could not install package 'Xamarin.Forms 2.2.0.45'. You are trying to install this package into a project that targets 'Unsupported,Version=v0.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
>---------------------------

Though, I am able to build and deploy the project on device but Xaml intelligence is not working.

Note You need to log in before you can comment on or make changes to this bug.