4

I start learning the Xamarin with the latest of VS 2015 (enterprise) I create a a cross platform project with the 'blank xml app'

xaml template

I got a solution with 5 projects created: portable, droid, ios, UWP and windows 8.1. All of them cannot get compiled at all, since the "initializecomponent" missing

InitializeComponent Missing

After I've updated the package Xamarin.forms to the latest version, almost of them can be compiled without any errors, except the windows 8.1. I tried around but got no luck, please advise which packages I need to install to?

enter image description here

Edited: add an image "cannot install the package xamarin.forms for the two.windows" enter image description here

moffeltje
  • 4,521
  • 4
  • 33
  • 57
khoailang
  • 725
  • 1
  • 15
  • 32

1 Answers1

1

Try to right-click the Two.Windows project -> click Manage NuGet Packages -> in the Installed packages tab, if Xamarin.Forms is listed, uninstall it -> Now click on the Online tab -> search for and install Xamarin.Forms only in your Two.Windows project

After that, I would completely close Visual Studio, click save if asked, delete all files and folders in each project folder's /bin/ and /obj/ folders, reopen the solution and rebuild the Two.Windows project.

If you still have issues after that let us know and also post a new image of the references listed under your Two.Windows project.

Edit: Here is a list of references that I see in my default Windows 8.1 project:

  • .NET for Windows Store app
    • Identity: .NETCore,Version=v4.5.1
    • Path: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETCore\v4.5.1\
  • Windows 8.1
    • Identity: Windows,Version=8.1
    • Path: C:\Program Files (x86)\Windows Kits\8.1\References\CommonConfiguration\Neutral\
  • Xamarin.Forms.Core
  • Xamarin.Forms.Platform
  • Xamarin.Forms.Platform.WinRT
  • Xamarin.Forms.Platform.WinRT.Tablet
  • Xamarin.Forms.Xaml

The I also have the reference to my shared project in there as well as Newtonsoft.Json, but I am not sure if that came by default or not.

Edit #2: Now that we know you are on Windows 7, we know why the Windows Phone 8.1 project is failing. Refer to this answer for more information but the short of it is that you cannot install the Windows Phone 8.1 SDK on Windows 7 nor can you deploy WP 8.1 apps using Windows 7. The answer also gives some alternatives you might be able to use. I think the upgrade is free from what I remember.

Community
  • 1
  • 1
hvaughan3
  • 10,955
  • 5
  • 56
  • 76
  • hi, cannot install the package xamarin.forms into the project two.windows, I edited my question to attach an image at last, thank you. – khoailang Jun 11 '16 at 17:36
  • @khoailang you might want to try right-clicking you solution and uninstalling and then reinstalling Xamarin Forms in all of the projects that need it. Not sure why it would error out like that. The project I currently have shows the `Xamarin.Forms` package happily sitting in the `Windows` project. – hvaughan3 Jun 11 '16 at 17:39
  • I am not sure why either, I have all kind of stuff has just installed fresh, just create new a project, have not yet modify any single line ... at the very first time projects created, no one can be compiled, I did removed the old package and install the latest version, some of them now work just the windows 8.1 doesn't – khoailang Jun 11 '16 at 17:45
  • can you please help to list out which dlls need to refer to? and where to get them, I can try to add manually myself – khoailang Jun 11 '16 at 18:18
  • @khoailang That really should not be necessary but I added the list of default references that I see in my **Window 8.1** project – hvaughan3 Jun 11 '16 at 18:33
  • thank you, I tried to have the VS 2015 installed in the Windows 10, everything is working just fine. As in the spec, the UWP just is supported in the Windows 10, but I am not sure if we need to have windows 8 installed for the "window 8.1" and "windows phone 8.1" project, is it? – khoailang Jun 16 '16 at 04:16
  • @khoailang No you do not need Windows 8.1 to run Windows Phone 8.1 projects. Could you try creating a brand new solution and seeing if the project works for you? – hvaughan3 Jun 16 '16 at 12:49
  • That is what I tried first, I always create a project solution, I even uninstalled and reinstalled the visual studio , my colleagues also got the same errors. We are using win 7 enterprise . – khoailang Jun 16 '16 at 12:56
  • @khoailang Ahh! Thats the issue. See Edit #2 in my answer. – hvaughan3 Jun 16 '16 at 12:59
  • @khoailang No problem, glad we got to the bottom of it! – hvaughan3 Jun 16 '16 at 13:46