Remove ios, windows8 and wp8 from Xamarin Forms PCL - nuget 3.0 in error?

I am working on a Xamarin Forms project. I want to target Android and Windows 10 UWP.

When I try to clear the PCL by removing "Windows 8", "Windows Phone Silverlight 8", "Windows Phone 8.1", "Xamarin.ios" and "Xamarin.ios (classic)" from the PCL targets, I get the following nasty .. .

I am just trying to uninstall WP8 as I don't care about its targeting.

Project objectives cannot be changed. For the chosen goals, the project for choosing support for NuGet 3.0, however, Visual Studio cannot automatically do this for you. Remove all NuGet packages and try again.

How do you get a project of choice in NuGet 3.0? Is there something else I should try?

environment: Xamarin Forms, VS2015

enter image description here

Thank....

+44
visual-studio-2015 nuget windows-10-universal xamarin.forms
Jan 27 '16 at 15:23
source share
8 answers

Solution that worked for me:

Delete Xamarin.Forms:

Right Click Solution -> Manage NuGet Packages -> Uninstall Xamarin.Forms -> Restart VS 

Then uninstall the platform assembly:

 Right Click Solution -> Properties -> Build -> under Targeting select Change -> Remove platform(s) -> Restart VS 

Reinstall Xamarin.Forms:

 Manage NuGet packages -> Search for Xamarin.Forms -> Install -> Restart VS 
+37
Jun 09 '16 at 0:05
source share

Another possible solution is to temporarily rename package.config, change the PCL settings to the new target platforms, and then change the name of package.config again. This worked for me in my project using VS 2015. I canโ€™t get a loan for this solution, read it on my blog some time ago and just post it here if it helps someone. If I get to the blog article again, I'll post the link here.

+13
May 05 '17 at 3:01 pm
source share

For me, this is what is fixed: Browse the packages.config file in this target project and remove ALL installed packages. Then you can change the targeting. Then reinstall your packages.

+4
Oct. 27 '16 at 13:23
source share

There are a couple of potential routes in the comments to the original question; one could try to remove all packages from projects and make the necessary changes before adding them again.

+3
Jan 27 '16 at 21:23
source share

For my initial prototype, I did not want to waste time on other platforms; So:

  • I started a new solution - "Blank App (Xamarin Forms Portable)"
  • I used the PackageManager to remove ALL packages from all projects.
  • I changed the Project Goals to exclude any Windows Mobile applications (he wanted to keep Windows 8.1, I think it was the .NET integration I wanted)
  • I deleted 3 windows projects
  • I used the PackageManager to read "Xamarin.Forms" for all other projects - and it automatically added all the other packages that existed at startup.

Now my solution is only (really) for Android and iOS ....

+2
Aug 18 '16 at 15:20
source share

If your problem is related to this option displayed everywhere in the solution, you can simply select the ones you do not want to show in the solution browser, then right-click and click "Unload project". They will remain there, increasing the size of the project, but they will leave the deployment list and other places.

+1
Jun 07 '16 at 21:23
source share

The best way to disable one of the builders is in the Solution Explorer, right-click on the assembly that you do not want to include as Windows or WinPhone, and click "Unload project". Then this assembly will change to (unavailable)

0
Dec 10 '16 at 1:10
source share

None of the above resolved my problem AND deleting nuget packages or editing a project file is NOT a solution (at least for me to talk about hellish hell), but this method works:

First, you cannot remove a single target platform, such as win8, silverlight, or the asp.net core, without degrading the .NET Framework as well.

If you uncheck Windows 8 and the ASP.NET kernel, uncheck the .NET Framework. Do not worry, it will not present the above error message, but VS will automatically check the .NET Framework (often a lower version), and then after re-adding the 8.1 window again after deleting the rest.

Once this happens, you can subsequently delete the rest. It took me some time to understand, since it is neither obvious nor explained anywhere. You do not need to delete Xamarin.Forms.

0
Sep 02 '17 at 18:23
source share



All Articles