2
votes

I am using Windows10, and have VS2015 installed which I tried running Xamarin on at first, however due to license cost of 1k I am now trying out Xamarin Studio instead, without much luck. I literally created blank project and tried building it and got missing Xamarin.Forms reference and when I tried adding it via nuget I got following:

Adding Xamarin.Forms... WARNING: Xamarin.Forms Package contains PowerShell scripts which will not be run. Installing 'Xamarin.Forms 2.0.0.6490'. Added file 'ICSharpCode.Decompiler.dll' to folder 'Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10'. Added file 'ICSharpCode.NRefactory.Cecil.dll' to folder 'Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10'. Added file 'ICSharpCode.NRefactory.CSharp.dll' to folder 'Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10'. Added file 'ICSharpCode.NRefactory.dll' to folder 'Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10'. Added file 'ICSharpCode.NRefactory.Xml.dll' to folder 'Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10'. Added file 'Mono.Cecil.dll' to folder 'Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10'. Added file 'Mono.Cecil.Mdb.dll' to folder 'Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10'. Added file 'Mono.Cecil.Pdb.dll' to folder 'Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10'. Added file 'Mono.Cecil.Rocks.dll' to folder 'Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10'. Added file 'Xamarin.Forms.Build.Tasks.dll' to folder 'Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10'. Added file 'Xamarin.Forms.Core.dll' to folder 'Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10'. Added file 'Xamarin.Forms.targets' to folder 'Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10'. Added file 'Xamarin.Forms.Xaml.dll' to folder 'Xamarin.Forms.2.0.0.6490\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10'. Added file 'FormsViewGroup.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\MonoAndroid10'. Added file 'Xamarin.Forms.Core.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\MonoAndroid10'. Added file 'Xamarin.Forms.Core.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\MonoAndroid10'. Added file 'Xamarin.Forms.Platform.Android.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\MonoAndroid10'. Added file 'Xamarin.Forms.Platform.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\MonoAndroid10'. Added file 'Xamarin.Forms.Xaml.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\MonoAndroid10'. Added file 'Xamarin.Forms.Xaml.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\MonoAndroid10'. Added file 'Xamarin.Forms.Core.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\MonoTouch10'. Added file 'Xamarin.Forms.Core.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\MonoTouch10'. Added file 'Xamarin.Forms.Platform.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\MonoTouch10'. Added file 'Xamarin.Forms.Platform.iOS.Classic.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\MonoTouch10'. Added file 'Xamarin.Forms.Xaml.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\MonoTouch10'. Added file 'Xamarin.Forms.Xaml.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\MonoTouch10'. Added file 'Xamarin.Forms.Core.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10'. Added file 'Xamarin.Forms.Core.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10'. Added file 'Xamarin.Forms.Platform.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10'. Added file 'Xamarin.Forms.Xaml.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10'. Added file 'Xamarin.Forms.Xaml.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10'. Added file 'Xamarin.Forms.Core.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\uap10.0'. Added file 'Xamarin.Forms.Core.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\uap10.0'. Added file 'Xamarin.Forms.Platform.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\uap10.0'. Added file 'Xamarin.Forms.Platform.UAP.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\uap10.0'. Added file 'Xamarin.Forms.Platform.UAP.pri' to folder 'Xamarin.Forms.2.0.0.6490\lib\uap10.0'. Added file 'FormsTextBox.xbf' to folder 'Xamarin.Forms.2.0.0.6490\lib\uap10.0\Xamarin.Forms.Platform.UAP'. Added file 'PageControl.xbf' to folder 'Xamarin.Forms.2.0.0.6490\lib\uap10.0\Xamarin.Forms.Platform.UAP'. Added file 'Xamarin.Forms.Platform.UAP.rd.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\uap10.0\Xamarin.Forms.Platform.UAP\Properties'. Added file 'Resources.xbf' to folder 'Xamarin.Forms.2.0.0.6490\lib\uap10.0\Xamarin.Forms.Platform.UAP'. Added file 'Xamarin.Forms.Platform.UAP.xr.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\uap10.0\Xamarin.Forms.Platform.UAP'. Added file 'Xamarin.Forms.Xaml.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\uap10.0'. Added file 'Xamarin.Forms.Xaml.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\uap10.0'. Added file 'Xamarin.Forms.Core.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\win81'. Added file 'Xamarin.Forms.Core.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\win81'. Added file 'Xamarin.Forms.Platform.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\win81'. Added file 'Xamarin.Forms.Platform.WinRT.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\win81'. Added file 'Xamarin.Forms.Platform.WinRT.pri' to folder 'Xamarin.Forms.2.0.0.6490\lib\win81'. Added file 'Xamarin.Forms.Platform.WinRT.Tablet.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\win81'. Added file 'Xamarin.Forms.Platform.WinRT.Tablet.pri' to folder 'Xamarin.Forms.2.0.0.6490\lib\win81'. Added file 'Resources.xbf' to folder 'Xamarin.Forms.2.0.0.6490\lib\win81\Xamarin.Forms.Platform.WinRT.Tablet'. Added file 'TabletResources.xbf' to folder 'Xamarin.Forms.2.0.0.6490\lib\win81\Xamarin.Forms.Platform.WinRT.Tablet'. Added file 'Xamarin.Forms.Platform.WinRT.Tablet.xr.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\win81\Xamarin.Forms.Platform.WinRT.Tablet'. Added file 'FormsTextBox.xbf' to folder 'Xamarin.Forms.2.0.0.6490\lib\win81\Xamarin.Forms.Platform.WinRT'. Added file 'PageControl.xbf' to folder 'Xamarin.Forms.2.0.0.6490\lib\win81\Xamarin.Forms.Platform.WinRT'. Added file 'StepperControl.xbf' to folder 'Xamarin.Forms.2.0.0.6490\lib\win81\Xamarin.Forms.Platform.WinRT'. Added file 'Xamarin.Forms.Platform.WinRT.xr.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\win81\Xamarin.Forms.Platform.WinRT'. Added file 'Xamarin.Forms.Xaml.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\win81'. Added file 'Xamarin.Forms.Xaml.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\win81'. Added file 'Xamarin.Forms.Core.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\WP80'. Added file 'Xamarin.Forms.Core.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\WP80'. Added file 'Xamarin.Forms.Platform.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\WP80'. Added file 'Xamarin.Forms.Platform.WP8.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\WP80'. Added file 'Xamarin.Forms.Xaml.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\WP80'. Added file 'Xamarin.Forms.Xaml.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\WP80'. Added file 'Xamarin.Forms.Core.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\wpa81'. Added file 'Xamarin.Forms.Core.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\wpa81'. Added file 'Xamarin.Forms.Platform.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\wpa81'. Added file 'Xamarin.Forms.Platform.WinRT.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\wpa81'. Added file 'Xamarin.Forms.Platform.WinRT.Phone.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\wpa81'. Added file 'Xamarin.Forms.Platform.WinRT.Phone.pri' to folder 'Xamarin.Forms.2.0.0.6490\lib\wpa81'. Added file 'PhoneResources.xbf' to folder 'Xamarin.Forms.2.0.0.6490\lib\wpa81\Xamarin.Forms.Platform.WinRT.Phone'. Added file 'Resources.xbf' to folder 'Xamarin.Forms.2.0.0.6490\lib\wpa81\Xamarin.Forms.Platform.WinRT.Phone'. Added file 'SearchBox.xbf' to folder 'Xamarin.Forms.2.0.0.6490\lib\wpa81\Xamarin.Forms.Platform.WinRT.Phone'. Added file 'Xamarin.Forms.Platform.WinRT.Phone.xr.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\wpa81\Xamarin.Forms.Platform.WinRT.Phone'. Added file 'Xamarin.Forms.Platform.WinRT.pri' to folder 'Xamarin.Forms.2.0.0.6490\lib\wpa81'. Added file 'FormsTextBox.xbf' to folder 'Xamarin.Forms.2.0.0.6490\lib\wpa81\Xamarin.Forms.Platform.WinRT'. Added file 'PageControl.xbf' to folder 'Xamarin.Forms.2.0.0.6490\lib\wpa81\Xamarin.Forms.Platform.WinRT'. Added file 'StepperControl.xbf' to folder 'Xamarin.Forms.2.0.0.6490\lib\wpa81\Xamarin.Forms.Platform.WinRT'. Added file 'Xamarin.Forms.Platform.WinRT.xr.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\wpa81\Xamarin.Forms.Platform.WinRT'. Added file 'Xamarin.Forms.Xaml.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\wpa81'. Added file 'Xamarin.Forms.Xaml.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\wpa81'. Added file 'Xamarin.Forms.Core.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\Xamarin.iOS10'. Added file 'Xamarin.Forms.Core.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\Xamarin.iOS10'. Added file 'Xamarin.Forms.Platform.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\Xamarin.iOS10'. Added file 'Xamarin.Forms.Platform.iOS.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\Xamarin.iOS10'. Added file 'Xamarin.Forms.Xaml.dll' to folder 'Xamarin.Forms.2.0.0.6490\lib\Xamarin.iOS10'. Added file 'Xamarin.Forms.Xaml.xml' to folder 'Xamarin.Forms.2.0.0.6490\lib\Xamarin.iOS10'. Added file 'init.ps1' to folder 'Xamarin.Forms.2.0.0.6490\tools'. Added file 'Xamarin.Forms.Core.Design.dll' to folder 'Xamarin.Forms.2.0.0.6490\tools'. Added file 'Xamarin.Forms.Xaml.Design.dll' to folder 'Xamarin.Forms.2.0.0.6490\tools'. Added file 'Xamarin.Forms.2.0.0.6490.nupkg' to folder 'Xamarin.Forms.2.0.0.6490'. Successfully installed 'Xamarin.Forms 2.0.0.6490'. Adding 'Xamarin.Forms 2.0.0.6490' to EmergencyAssistanceResponseSystem. Object reference not set to an instance of an object.

Judging by last couple of lines, it would appear that it gets nuget as it is comfortably sitting in packages/Xamarin.Forms.2.0.0.6490 however fails to be referenced in project for whatever reason Adding 'Xamarin.Forms 2.0.0.6490' to EmergencyAssistanceResponseSystem. Object reference not set to an instance of an object.

How do I debug this any further as it is kinda obvious that some reference is missing but where and what?

EDIT1: Indeed in log files in my case (C:\Users\[User]\AppData\Local\XamarinStudio-5.0\Logs) I was able to find following:

Could not add Xamarin.Forms.
System.NullReferenceException: Object reference not set to an instance of an object.
   at NuGet.NetPortableProfileTable.GetProfile(String profileName)
   at NuGet.NetPortableProfile.Parse(String profileValue, Boolean treatOptionalFrameworksAsSupportedFrameworks)
   at NuGet.VersionUtility.IsPortableLibraryCompatible(FrameworkName projectFrameworkName, FrameworkName packageTargetFrameworkName)
   at NuGet.VersionUtility.IsCompatible(FrameworkName projectFrameworkName, FrameworkName packageTargetFrameworkName)
   at NuGet.VersionUtility.<>c__DisplayClass19`1.<TryGetCompatibleItems>b__13(IGrouping`2 g)
   at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__1.MoveNext()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at NuGet.VersionUtility.TryGetCompatibleItems[T](FrameworkName projectFramework, IEnumerable`1 items, IEnumerable`1& compatibleItems)
   at NuGet.ProjectSystemExtensions.GetCompatibleItemsCore[T](IProjectSystem projectSystem, IEnumerable`1 items)
   at NuGet.ProjectManager.ExtractPackageFilesToProject(IPackage package)
   at NuGet.ProjectManager.AddPackageReferenceToProject(IPackage package)
   at NuGet.ProjectManager.Execute(PackageOperation operation)
   at NuGet.ProjectManager.Execute(IPackage package, IPackageOperationResolver resolver)
   at NuGet.ProjectManager.AddPackageReference(IPackage package, Boolean ignoreDependencies, Boolean allowPrereleaseVersions)
   at NuGet.ProjectManager.AddPackageReference(String packageId, SemanticVersion version, Boolean ignoreDependencies, Boolean allowPrereleaseVersions)
   at ICSharpCode.PackageManagement.SharpDevelopPackageManager.AddPackageReference(IPackage package, Boolean ignoreDependencies, Boolean allowPrereleaseVersions)
   at ICSharpCode.PackageManagement.SharpDevelopPackageManager.InstallPackage(IPackage package, InstallPackageAction installAction)
   at ICSharpCode.PackageManagement.PackageManagementProject.InstallPackage(IPackage package, InstallPackageAction installAction)
   at ICSharpCode.PackageManagement.InstallPackageAction.ExecuteCore()
   at ICSharpCode.PackageManagement.ProcessPackageAction.Execute()
   at MonoDevelop.PackageManagement.BackgroundPackageActionRunner.RunActionsWithProgressMonitor(IProgressMonitor monitor, IList`1 packageActions)
   at MonoDevelop.PackageManagement.BackgroundPackageActionRunner.RunActionsWithProgressMonitor(ProgressMonitorStatusMessage progressMessage, IList`1 installPackageActions)
1
What Xamarin version are you using? Starter, Indie?CSharpRocks
@CSharpRocks This one ctrlv.cz/UaTXMatas Vaitkevicius
If you are using Xamarin Studio then the full exception call stack should be in the IDE log (Help - Open Log Directory). That may indicate where the problem is.Matt Ward

1 Answers

2
votes

If the reference is the problem, inside your project folder there will be "Package" folder, using Xamarin studio you can add the dll manually, to do this:

  1. Right click on the Reference folder (On each platform)
  2. Click on "Edit References"
  3. Navigate to the tab called ".Net Assembly"
  4. Browse to the package folder inside your project and add the specific .dll that is missing.

Note: If the package folder does not contain the nugget that you are looking for, you can add dll's from another projects which you already have downloaded and then you will be able to compile. Hope this helps.