Bug 61130 - NullReferenceException when trying to open axml file after updating VS to the latest version
Summary: NullReferenceException when trying to open axml file after updating VS to the...
Status: NEW
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Android Designer ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-12-28 00:02 UTC by Barak Hammel
Modified: 2018-03-07 10:54 UTC (History)
5 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 for Bug 61130 on Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.
Related Links:
Status:
NEW

Description Barak Hammel 2017-12-28 00:02:24 UTC
I've updated to the latest version of VS 2017, after the update completed, I was trying to open one of my AXML files, then I received generic exception with a redirection to log file locate at:
"...\AppData\Roaming\Microsoft\VisualStudio\15.0_31058533\ActivityLog.xml"

The exception in this log file is a NullReferenceException:
"
Object reference not set to an instance of an object. at Xamarin.AndroidDesigner.DesignerProjectExtensions.GetProperty[T](DesignerProject project, Int32 propid) in E:\A\_work\12\s\Xamarin.Designer.VisualStudio\src\VisualStudio.Android.Designer\Extensions\DesignerProjectExtensions.cs:line 17 at Xamarin.VisualStudio.Android.Designer.MonoAndroidDesignerService.GetAndroidTargetFrameworkVersion(DesignerProject designerProject) in E:\A\_work\12\s\Xamarin.Designer.VisualStudio\src\VisualStudio.Android.Designer\MonoAndroidDesignerService.cs:line 188 at Xamarin.VisualStudio.Android.Designer.MonoAndroidDesignerService.GetCurrentAndroidTargetFor(DesignerProject designerProject) in E:\A\_work\12\s\Xamarin.Designer.VisualStudio\src\VisualStudio.Android.Designer\MonoAndroidDesignerService.cs:line 141 at Xamarin.VisualStudio.Android.Designer.MonoAndroidDesignerService.FindBestAndroidTarget(DesignerProject designerProject, Int32 apiLevel) in E:\A\_work\12\s\Xamarin.Designer.VisualStudio\src\VisualStudio.Android.Designer\MonoAndroidDesignerService.cs:line 136 at Xamarin.VisualStudio.Android.Designer.AxmlTextViewCreationListener.VsTextViewCreated(IVsTextView textViewAdapter) in E:\A\_work\12\s\Xamarin.Designer.VisualStudio\src\VisualStudio.Android.Designer\Editor\AxmlTextViewCreationListener.cs:line 59 at Microsoft.VisualStudio.Editor.Implementation.SimpleTextViewWindow.<>c__DisplayClass565_0.<SendVsTextViewCreated>b__0() at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call) --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
"


It seems that somehow visual studio is trying to load this extension from drive "E", however I only have drive "C" in my computer... It seems that somehow visual studio's settings has changed during the last update with wrong value...
Comment 1 Chris 2018-03-07 10:54:07 UTC
I have the same or a similar issue, the exception is pointing to drive E here too.

System.NullReferenceException: Object reference not set to an instance of an object. at Xamarin.VisualStudio.Android.Designer.MonoAndroidDesignerService.FindBestAndroidTarget(DesignerProject designerProject, Int32 apiLevel) in E:\A\_work\12\s\Xamarin.Designer.VisualStudio\src\VisualStudio.Android.Designer\MonoAndroidDesignerService.cs:line 136 at Xamarin.VisualStudio.Android.Designer.AxmlTextViewCreationListener.VsTextViewCreated(IVsTextView textViewAdapter) in E:\A\_work\12\s\Xamarin.Designer.VisualStudio\src\VisualStudio.Android.Designer\Editor\AxmlTextViewCreationListener.cs:line 59 at Microsoft.VisualStudio.Editor.Implementation.SimpleTextViewWindow.<>c__DisplayClass565_0.<SendVsTextViewCreated>b__0() at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call) --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)