Bug 16309 - Installer incompletely configures system for PCL usage
Summary: Installer incompletely configures system for PCL usage
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 1.8.x
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Martin Baulig
Depends on:
Reported: 2013-11-17 21:53 UTC by Brian
Modified: 2016-11-11 09:33 UTC (History)
8 users (show)

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

version info from Windows PC (2.75 KB, text/plain)
2013-11-17 21:53 UTC, Brian

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:

Description Brian 2013-11-17 21:53:10 UTC
Created attachment 5461 [details]
version info from Windows PC

I recently wiped my development machine of all traces of Xamarin and Visual Studio 2012. Then I re-installed Visual Studio and the latest stable build of the Xamarin tools.

I tried to create a Portable Class Library that targeted the .NET Framework 4.5, Windows Phone 8, Xamarin.Android, and Xamarin.iOS. However, the Change Target Frameworks dialog in Visual Studio wouldn't allow this combination, complaining that "There is no available functionality that is portable between the frameworks you have selected". This confused me, as this combination should be allowed.

After investigating, I discovered that the installer had created the "Xamarin.Android.xml" and "Xamarin.iOS.xml" files in the "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile7\SupportedFrameworks" folder, but failed to copy these files to the sibling Profile49 and Profile78 folders.

I copied these files manually (requiring Administrator approval) from the Profile7 folder to the other profile folders and restart Visual Studio. Afterward, the Change Target Frameworks dialog worked as expected. This explains why "Xamarin.Android" and "Xamarin.iOS" was listed in the Change Target Frameworks dialog, but wouldn't work when combined with Windows Phone 8.

I have attached my full version information for your reference.
Comment 1 Oleg Demchenko 2013-12-03 12:41:33 UTC
Hi Brian, 
I tried to reproduce your issue with next steps:

1) Uninstall Xamarin iOS/Android & Visual Studio 2012
2) Install Visual Studio 2012, Xamarin.iOS 1.8.365 & Xamarin.Android 4.10.01073
3) Create PCL library with .NET Framework
4.5, Windows Phone 8, Xamarin.Android, and Xamarin.iOS targeting successfully.

Complaining did not appeared.  Also Xamarin.Android.xml and Xamarin.iOS.xml were installed in Profile7, Profile49, Profile78 folders. 
The profiles should be installed correctly if you have the Xamarin.iOS 1.8.365 & Xamarin.Android 4.10.01073
Comment 2 PJ 2013-12-03 17:48:56 UTC
It looks like Brian does have 1.8.365 and installed from the attached version info.

There is a flag during the installation that checks for the Windows Phone 8 SDK, and if it's there it will install into 49 and 78, but if it's not it won't.

It looks like you have the Windows Phone 8 SDK installed now, but is it possible you didn't have it installed when you installed the latest versions of Xamarin?

I'm going to set this to NEEDINFO so we can get a follow-up from Brian.
Comment 3 Brian 2013-12-06 00:25:37 UTC
It is possible that I installed Visual Studio, then Xamarin, and then Windows Phone 8. I am not certain.

If that is what caused the problem, then I think it would be very helpful if Xamarin at least detected that target frameworks were installed since the last time it ran and preferably offered some information on how to update things.

The way it works now, it is not at all obvious what the problem is. The only reason I was able to figure it out is that I had previously done some hacking to get PCLs working, so I had an idea of what the Frameworks folders and files should  look like.

What is the recommended procedure if a target framework is added after Xamarin is installed? Should Xamarin be installed again? Does it need to be uninstalled and then reinstalled? Can we get this procedure documented?
Comment 4 Martin Baulig 2013-12-06 11:54:22 UTC
The PCL component is installed as a separate "feature" of the .msi installer.  The idea was that people should be able to run "Update" or "Repair" (Control Panel / Software / right-click on the name) on it after installing new target frameworks.

However, during those busy days that lead up towards the PCL release, it's possible that this never got fully tested.  It is supposed to be there, but I must admit that I'm not sure whether the code has actually been written for it.  I'll have a look.
Comment 5 Martin Baulig 2016-11-11 09:33:11 UTC
Closing ancient bugs, please reopen if you're still having this problem.