Bug 59880 - NullReferenceException when double-clicking any .xaml file if using Shared XamarinForms F# blank template
Summary: NullReferenceException when double-clicking any .xaml file if using Shared Xa...
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Xamarin.Forms Previewer (show other bugs)
Version: 7.1 (d15-3)
Hardware: PC Mac OS
: --- normal
Target Milestone: 15.4
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-10-01 08:35 UTC by Andres G. Aragoneses
Modified: 2017-10-09 20:03 UTC (History)
4 users (show)

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


Attachments

Description Andres G. Aragoneses 2017-10-01 08:35:41 UTC
Using VSforMac 7.1.5 (build 2)

Steps to reproduce:
1. Launch VSforMac.
2. Click on New Project... choose MultiPlatform -> App -> Blank Forms App
3. Select F# language, Next.
4. App name: foo
5. Organization identifier: bar.baz
6. Leave both Android and iOS platform options checked.
7. Choose Shared Library.
8. Leave XAML checkbox checked.
9. Project name: Foo. Solution name: Foo.
10. Click on Create button.
11. Build solution (fix any compiler errors if any, e.g. using a workaround if encountering bug 59879, build again).
12. Open Foo project in the left panel, double-click on "FooPage.xaml".
13. Double click file FooPage.xaml.

Expected results: should render a Xamarin Forms designer?

Current results:
There was a problem rendering this document:
System.NullReferenceException: Object reference not set to an instance of an object
  at MonoDevelop.MonoDroid.Designer.IdeDesignerProject.GetEvaluatedPathProperty (System.String name, System.Boolean isStoredAsAbsolutePath) [0x00000] in /Users/builder/data/lanes/5123/7afedcae/source/md-addins/MonoDevelop.MonoDroid/MonoDevelop.MonoDroid/Designer/IdeDesignerProject.cs:150 
  at Xamarin.AndroidDesigner.DesignerProject.get_HasSourceAssemblies () [0x00000] in /Users/builder/data/lanes/5123/7afedcae/source/md-addins/MonoDevelop.MonoDroid/Xamarin.AndroidDesigner/Xamarin.AndroidDesigner/DesignerProject.cs:1300 
  at Xamarin.Designer.Forms.Preview.AndroidXamlRenderer+<EnsureSessionIsReady>d__15.MoveNext () [0x0013c] in /Users/builder/data/lanes/5123/7afedcae/source/md-addins/Xamarin.Designer.Forms/Xamarin.Designer.Forms.Preview/Android/AndroidXamlRenderer.cs:89 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:113 
  at Xamarin.Designer.Forms.Preview.AndroidXamlRenderer+<RenderOneXaml>d__17.MoveNext () [0x00035] in /Users/builder/data/lanes/5123/7afedcae/source/md-addins/Xamarin.Designer.Forms/Xamarin.Designer.Forms.Preview/Android/AndroidXamlRenderer.cs:124 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:357 
  at Xamarin.Designer.Forms.Preview.AndroidXamlRenderer+<RenderXamls>d__18.MoveNext () [0x0007a] in /Users/builder/data/lanes/5123/7afedcae/source/md-addins/Xamarin.Designer.Forms/Xamarin.Designer.Forms.Preview/Android/AndroidXamlRenderer.cs:198


Workaround: in step 7, choose Portable library instead of Shared.
Comment 1 Jérémie Laval 2017-10-09 20:03:20 UTC
This issue doesn't appear with the latest VSMac 7.2 (aka 15.4) build of Visual Studio for Mac so I'll mark it as resolved fixed for now, feel free to re-open if it persists for you (7.2 is going out to stable very soon).

Note You need to log in before you can comment on or make changes to this bug.