Bug 53876 - Xamarin.VisualStudio.Inspector NullReferenceException from GetProjectFlavor() for VS2017 ASP.NET Core Web Application (.Net Core)
Summary: Xamarin.VisualStudio.Inspector NullReferenceException from GetProjectFlavor()...
Status: RESOLVED DUPLICATE of bug 54329
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: General ()
Version: 4.3.0 (C9)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-03-23 18:56 UTC by Jim Albert
Modified: 2017-05-16 19:34 UTC (History)
9 users (show)

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

About Microsoft Visual Studio (6.60 KB, text/plain)
2017-03-23 18:56 UTC, Jim Albert

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:

Description Jim Albert 2017-03-23 18:56:25 UTC
Created attachment 20774 [details]
About Microsoft Visual Studio

I have a Xamarin.Forms project that's using a WebView to display the contents of an ASP.NET Website, the project for which is also in the solution.  When I debug the Website project, the Debugger Output in Visual Studio is being spammed with NullReferenceException's from Xamarin.VisualStudio.Inspector

Steps to Reproduce
1. Create a new, empty, ASP.NET Core Web Application (.Net Core) in Visual Studio 2017
2. Add to the solution a new, empty Cross Platform App (Xamarin.Forms, w/PCL)
3. Start debugging the WebApplication project in IIS Express

Actual Results (Debugger Output)
[Inspector] Error preparing project for inspection: System.NullReferenceException: Object reference not set to an instance of an object.
   at Xamarin.VisualStudio.Inspector.ProjectExtensions.GetProjectFlavor(IAdaptable`1 adaptableProj) in C:\d\lanes\4368\73f58d6d\source\xamarinvs\src\Features\VisualStudio.Inspector\Vsix\Extensions\ProjectExtensions.cs:line 62
   at Xamarin.VisualStudio.Inspector.VSAgentExecutionTarget..ctor(Project proj) in C:\d\lanes\4368\73f58d6d\source\xamarinvs\src\Features\VisualStudio.Inspector\Vsix\VSAgentExecutionTarget.cs:line 42
   at Xamarin.VisualStudio.Inspector.VSInspectorSession.CreateAgentExecutionTarget() in C:\d\lanes\4368\73f58d6d\source\xamarinvs\src\Features\VisualStudio.Inspector\Vsix\VSInspectorSession.cs:line 84
   at Xamarin.Interactive.IdeSupport.InspectorSession.Prepare() in C:\d\lanes\4368\73f58d6d\source\xamarinvs\External\inspector-ide-integration\Xamarin.Interactive.IdeSupport\InspectorSession.cs:line 95
   at Xamarin.VisualStudio.Inspector.XamarinInspectorPackage.RefreshInspectorSession() in C:\d\lanes\4368\73f58d6d\source\xamarinvs\src\Features\VisualStudio.Inspector\Vsix\XamarinInspectorPackage.cs:line 136

Expected Results
No errors/exceptions in the debugger output

Build Date & Hardware
2017-03-23, Windows 7 64bit, Visual Studio 2017

Additional Information
I was able to temporarily work-around the problem by manually removing all files and references to Xamarin.VisualStudio.Inspector from the folder "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Xamarin.VisualStudio".  However, I then get a dialog box when loading the solution that the "XamarinInspectorPackage" couldn't be loaded.
Comment 1 Jahmai 2017-03-25 04:02:19 UTC
This just spams the output window when debugging. Even non-Xamarin projects.
Comment 2 Axel 2017-03-27 07:22:16 UTC
+1 this is critical, it spams the output window which make it unsable for debug for all non xamarin project....
Comment 3 Satya 2017-03-30 21:21:47 UTC
+1 this is important to fix. Can't find the actual exception while debugging anything.
Comment 4 Daniel Cazzulino 2017-04-06 21:34:11 UTC
This is fixed in the upcoming 15.2 release.
Comment 5 Sandy Armstrong [MSFT] 2017-04-06 21:36:10 UTC

*** This bug has been marked as a duplicate of bug 54329 ***
Comment 6 Eric F. 2017-05-16 19:29:43 UTC
Not fixed in 15.2. I still have this bug.
Comment 7 Sandy Armstrong [MSFT] 2017-05-16 19:31:33 UTC
Eric, it will be extra-fixed in 15.2.2. Sorry for the trouble!
Comment 8 Sandy Armstrong [MSFT] 2017-05-16 19:34:35 UTC
I'm sorry, I mixed this up with another bug.

This will be fixed in 15.3.