microsoft / PTVS

Python Tools for Visual Studio
https://aka.ms/PTVS
Apache License 2.0
2.53k stars 676 forks source link

NullReferenceException when closing project with test explorer open #4727

Closed huguesv closed 5 years ago

huguesv commented 6 years ago
System.NullReferenceException
  HResult=0x80004003
  Message=Object reference not set to an instance of an object.
  Source=Microsoft.PythonTools
  StackTrace:
   at Microsoft.PythonTools.Project.PythonProjectNode.GetInterpreterFactoryOrThrow() in C:\Projects\GitHub\huguesv\PTVS\Python\Product\PythonTools\PythonTools\Project\PythonProjectNode.cs:line 1237
>   Microsoft.PythonTools.dll!Microsoft.PythonTools.Project.PythonProjectNode.GetInterpreterFactoryOrThrow() Line 1237  C#
    Microsoft.PythonTools.dll!Microsoft.PythonTools.Project.PythonProjectNode.GetLaunchConfigurationOrThrow() Line 1265 C#
    Microsoft.PythonTools.dll!Microsoft.PythonTools.Project.PythonProjectNode.VsPythonProject.GetLaunchConfigurationOrThrow() Line 2915 C#
    Microsoft.PythonTools.TestAdapter.dll!Microsoft.PythonTools.TestAdapter.PythonRunSettings.AddRunSettings.AnonymousMethod__1() Line 130  C#
    [Resuming Async Method] 
    [External Code] 

image

Hit F5 to continue debugging, and I get: image

And this in output window:

[9/25/2018 3:51:50 PM Informational] ========== Discover test finished: 1 found (0:00:03.752562) ==========
[9/25/2018 3:51:52 PM Informational] ------ Discover test started ------
[9/25/2018 3:55:37 PM Error] Failed to configure settings for runsettings plugin 'Python Run Settings' as it threw following exception:
'Cannot access a disposed object.'
Please contact the plugin author.
[9/25/2018 3:55:37 PM Informational] ========== Discover test finished: 1 found (0:03:45.3637455) ==========
huguesv commented 5 years ago

No repro in a while.