Bug 44956 - Android Designer fails to load F# project with System.NullReferenceException: Object reference not set to an instance of an object
Summary: Android Designer fails to load F# project with System.NullReferenceException:...
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Designer Integration ()
Version: 4.2.0 (C8)
Hardware: PC Windows
: High major
Target Milestone: 4.3.0 (C9)
Assignee: Adrian Alonso
URL:
: 44797 ()
Depends on:
Blocks:
 
Reported: 2016-09-30 21:29 UTC by Ashley Gazich [MSFT]
Modified: 2017-01-12 06:37 UTC (History)
17 users (show)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Ashley Gazich [MSFT] 2016-09-30 21:29:02 UTC
### Steps to reproduce

Create new Android F# project
Open Main.axml


### Results

System.NullReferenceException: Object reference not set to an instance of an object.
   at Xamarin.VisualStudio.Android.MonoAndroidDesignerInterface.VisualStudioCodeModelBridge.get_EnclosingProject() in C:\data\lanes\3822\76037860\source\xamarinvs\src\Core\VisualStudio.Android\Designer\MonoAndroidDesignerInterface.cs:line 180
   at Xamarin.AndroidDesigner.CodeInteractions.CodeModelBridge.<GetCompilationAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.AndroidDesigner.CodeInteractions.CodeModelBridge.<GetDesignerResourceEntries>d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.AndroidDesigner.DesignerProject.<UpdateDesignerResourceIds>d__175.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.AndroidDesigner.DesignerProject.<EnsureLoaded>d__139.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.AndroidDesigner.AndroidRenderSession.<InitSession>d__105.MoveNext()


Note: New Android C# project loads without issue.


### Version information

Microsoft Visual Studio Professional 2015
Version 14.0.25123.00 Update 2
Microsoft .NET Framework
Version 4.6.01055

Installed Version: Professional

LightSwitch for Visual Studio 2015   00322-40000-00000-AA306
Microsoft LightSwitch for Visual Studio 2015

Visual Basic 2015   00322-40000-00000-AA306
Microsoft Visual Basic 2015

Visual C# 2015   00322-40000-00000-AA306
Microsoft Visual C# 2015

Visual C++ 2015   00322-40000-00000-AA306
Microsoft Visual C++ 2015

Visual F# 2015   00322-40000-00000-AA306
Microsoft Visual F# 2015

Application Insights Tools for Visual Studio Package   7.0.20622.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 (Beta8)   14.1.11106.0
ASP.NET and Web Tools 2015.1 (Beta8)

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

Clang with Microsoft CodeGen   14.0.25516
Clang with Microsoft CodeGen

Command Bus, Event Stream and Async Manager   Merq
Provides ICommandBus, IEventStream and IAsyncManager MEF services for loosely coupled Visual Studio extension components communication and integration.

Common Azure Tools   1.7
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

KofePackagePackage Extension   1.0
KofePackagePackage Visual Studio Extension Detailed Info

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

NuGet Package Manager   3.4.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   14.0.60311.1
Microsoft SQL Server Data Tools

TypeScript   1.8.29.0
TypeScript tools for Visual Studio

Visual C++ for Cross Platform Mobile Development (Android)   14.0.25401.00
Visual C++ for Cross Platform Mobile Development (Android)

Visual C++ for Cross Platform Mobile Development (iOS)   14.0.25401.00
Visual C++ for Cross Platform Mobile Development (iOS)

Visual Studio Tools for Apache Cordova   Update 10
Visual Studio Tools for Apache Cordova

Xamarin   4.2.0.695 (7603786)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   7.0.1.2 (c1d1c79)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   10.0.0.1 (29910bb)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 2 Jimmy [MSFT] 2016-10-01 07:10:43 UTC
Marking as CONFIRMED since I can reproduce the exception using the steps given.

### Version Info
Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Enterprise

Architecture and Modeling Tools   00322-80000-00000-AA455
Microsoft Architecture and Modeling Tools
    
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

LightSwitch for Visual Studio 2015   00322-80000-00000-AA455
Microsoft LightSwitch for Visual Studio 2015

Visual Basic 2015   00322-80000-00000-AA455
Microsoft Visual Basic 2015

Visual C# 2015   00322-80000-00000-AA455
Microsoft Visual C# 2015

Visual C++ 2015   00322-80000-00000-AA455
Microsoft Visual C++ 2015

Visual F# 2015   00322-80000-00000-AA455
Microsoft Visual F# 2015

Windows Phone SDK 8.0 - ENU   00322-80000-00000-AA455
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   7.8.00927.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 (Beta8)   14.1.11107.0
ASP.NET and Web Tools 2015.1 (Beta8)

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

Clear MEF Component Cache   1.3.1
Clears the Visual Studio MEF component cache to fix issues with cache corruption.

Command Bus, Event Stream and Async Manager   Merq
Provides ICommandBus, IEventStream and IAsyncManager MEF services for loosely coupled Visual Studio extension components communication and integration.

Common Azure Tools   1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GitHub.VisualStudio   1.0
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

NuGet Package Manager   3.4.4
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

OptionsPackage Extension   1.0
OptionsPackage Visual Studio Extension Detailed Info

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   14.0.60519.0
Microsoft SQL Server Data Tools

TypeScript   1.8.36.0
TypeScript tools for Visual Studio

Visual Studio Tools for Universal Windows Apps   14.0.25527.01
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Xamarin   4.2.0.698 (016ed17)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   7.0.1.2 (c1d1c79)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   10.0.0.1 (29910bb)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 4 Brendan Zagaeski (Xamarin Team, assistant) 2016-10-03 17:53:22 UTC
*** Bug 44797 has been marked as a duplicate of this bug. ***
Comment 5 semuserable 2016-10-15 19:17:22 UTC
Same problem here. When will it be resolved? Also, why I can't access Bug 44797?
Comment 6 Brendan Zagaeski (Xamarin Team, assistant) 2016-10-15 19:31:04 UTC
The current target milestone for this bug is Cycle 9 which is tentatively scheduled for preview releases during the month of November.

Bug 44797 was filed as a private bug by the user who reported it.  It is accordingly only visible to the reporter and members of the Xamarin team.  But that bug has been closed as a duplicate of this bug, so this public bug will be the location used for future updates on the status of the bug from the Xamarin team.
Comment 7 Jürgen Hötzel 2016-10-20 17:26:07 UTC
Is there any workaround available? Thanks.
Comment 8 Jérémie Laval 2016-11-16 21:00:55 UTC
VisualStudioCodeModelBridge needs some error handling to cope with (what I assume is) the lack of Roslyn structures for F# projects and return `null` when that happen.
Comment 10 Danish Akhtar 2017-01-12 06:37:09 UTC
I am also able to reproduce this issue with C8 XVS 4.2.2.11.
However with latest C9 XVS 4.3.0.561 and with master XVS 99.1.0.467 and observed that now this issue is not exists. I am successfully able to open Android Designer with F# project in VS.

Screencast for the same: https://www.screencast.com/t/tznpoEWNE

Hence closing this issue.