Bug 26125 - Adding CardView NuGet fails unless TargetFrameworkVersion is manually added to csproj.
Summary: Adding CardView NuGet fails unless TargetFrameworkVersion is manually added t...
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android ()
Version: unspecified
Hardware: PC Windows
: Normal normal
Target Milestone: 15.2
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-01-16 16:28 UTC by Mark McLemore
Modified: 2017-05-29 20:29 UTC (History)
7 users (show)

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


Attachments
Error installing CardView NuGet (58.39 KB, image/png)
2015-01-16 16:28 UTC, Mark McLemore
Details


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:
RESOLVED FIXED

Description Mark McLemore 2015-01-16 16:28:58 UTC
Created attachment 9388 [details]
Error installing CardView NuGet

I'm on Visual Studio 2013 Pro with Xamarin 3.1.150.0, Xamarin.Android 4.20.0.28, and NuGet Package Manager 2.8.5096 on Windows 7 Pro x64.

I did the following to recreate this issue:

1. Created a new Blank Android app.
2. Set the Minimum and Target Android version to API Level 21 (Android v5.0 support).
3. Set to compile using latest platform (API Level 21).
4. Ran the Android SDK manager and ensured that all updates are installed.
5. Right-click References > Manage NuGet Packages > Search for CardView > Install.
6. After I click the CardView Install, I get the "Could not install package" error (see attached screen shot for details).

After some digging and experimentation, I found that adding this to the .csproj file
cleared up the problem and allowed the install to work:

<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>

It looks like this element is added to the .csproj when you create the project in Xamarin Studio, but it's NOT added when the project is first created in Visual Studio. If I take an Android 5.0 project that is created in Xamarin Studio, open it in Visual Studio, then try to add the CardView NuGet, then the install works.
Comment 1 Sunil Kumar 2015-01-19 09:52:17 UTC
We have tried to reproduce this issue and able to reproduce. After we click the CardView Install,  CardView NuGet fails to install.

Screencast: http://www.screencast.com/t/imsVSLNmznTW
Package Manager Log: https://gist.github.com/AkhileshKumar01/3cb9551f9ec4eaf8dbe6
IDE Log: https://gist.github.com/AkhileshKumar01/a0a4f404d2cceeb9261b

Environment info:
Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.50938

Xamarin   3.9.236.0 (d6a2cae)
Xamarin.Android   4.20.0.34 (49a04b966feb40dfdba49d57ba16249b66d606a6)
Xamarin.iOS   8.6.0.0 (eb24bdcf5cba2c12b673a07e0a8cce368b9563b3)
Comment 2 Juan Marcelo Tondato 2017-05-29 20:29:55 UTC
Hi,
As we've introduced several improvements around this area, I'll mark the bug as resolved fixed.
Please feel free to reopen it if you can still reproduce the issue with current bits.
Thanks!