xamarin / xamarin-forms-book-samples

Code samples for "Creating Mobile Apps with Xamarin.Forms"
Apache License 2.0
725 stars 565 forks source link

Opening projects in VS 2017 #19

Open aaronshim opened 7 years ago

aaronshim commented 7 years ago

Attempting to open projects using VS 2017 Community will result in the following message (this particular batch is for the project Hello in Chapter 2):

Unsupported
This version of Visual Studio is unable to open the following projects. The project types may not be installed or this version of Visual Studio may not support them. 
For more information on enabling these project types or otherwise migrating your assets, please see the details in the "Migration Report" displayed after clicking OK.
     - Hello.Windows, "C:\Users\Aaron\Documents\Visual Studio 2017\Projects\xamarin-forms-book-samples-master\Chapter02\Hello\Hello\Hello.Windows\Hello.Windows.csproj"
     - Hello.WinPhone, "C:\Users\Aaron\Documents\Visual Studio 2017\Projects\xamarin-forms-book-samples-master\Chapter02\Hello\Hello\Hello.WinPhone\Hello.WinPhone.csproj"

No changes required
These projects can be opened in Visual Studio 2015, Visual Studio 2013, Visual Studio 2012, and Visual Studio 2010 SP1 without changing them.
     - Hello, "C:\Users\Aaron\Documents\Visual Studio 2017\Projects\xamarin-forms-book-samples-master\Chapter02\Hello\Hello\Hello\Hello.csproj"
     - Hello.iOS, "C:\Users\Aaron\Documents\Visual Studio 2017\Projects\xamarin-forms-book-samples-master\Chapter02\Hello\Hello\Hello.iOS\Hello.iOS.csproj"
     - Hello.Droid, "C:\Users\Aaron\Documents\Visual Studio 2017\Projects\xamarin-forms-book-samples-master\Chapter02\Hello\Hello\Hello.Droid\Hello.Droid.csproj"
     - Hello.UWP, "C:\Users\Aaron\Documents\Visual Studio 2017\Projects\xamarin-forms-book-samples-master\Chapter02\Hello\Hello\Hello.UWP\Hello.UWP.csproj"
     - Hello, "C:\Users\Aaron\Documents\Visual Studio 2017\Projects\xamarin-forms-book-samples-master\Chapter02\Hello\Hello.sln"

Most of the projects will display a similar "Unsupported" message. Are there plans to update these example files for VS 2017? What are the minimum steps I can take to get these examples to open in VS 2017? Thank you for your help.

charlespetzold commented 7 years ago

Visual Studio 2017 does not support Windows Store 8.1 or Windows Phone 8.1 projects. Although those project types are not deprecated, the most recent solution templates for Xamarin.Forms do not include those projects.

If you need to continue using those projects in Xamarin.Forms, stick with Visual Studio 2015. If you don’t need those projects, you can simply ignore them or delete them from the solution within Visual Studio 2017.

snazitup commented 7 years ago

Thank you @charlespetzold, I was doing some looking to find a workaround, but now am going back to VS 2015 instead. I appreciate your straightforward answer!

ravenrgg commented 6 years ago

I am perfectly happy to delete the Win8 version, but none of the code I've tried compiles after deleting those projects. I tried starting with a clean .net solution and adding the source code, but that doesn't work either.

I have the Nov. 7, 2017 download of the xamarin-forms-book-samples-master code and am using VS Community 15.5.2. This is the one where PCL is no longer available but .net is used. The sample code seems to be for PCL.

charlespetzold commented 6 years ago

I just loaded a solution from the book into VS 2017 Professional Version 15.5.1, and I was able to build for Android, iOS, and UWP without a problem. I didn't even have to delete the Windows and WinPhone solutions.

I will upgrade to 15.5.2 and see if that makes a difference.

At some point we're going to try converting all the code over to .NET Standard, but apparently some non-upgraded versions of Windows 10 won't run that code, and that's undesirable for us.

For that reason, I'm still using VS 2015 for most of my Xamarin.Forms work.

ravenrgg commented 6 years ago

I'm trying to get the library Xamarin.FormsBook.Platform to compile. Thanks for looking at this.