private void RemoveVsProjectAdapterFromCache(string name) { // Do nothing if the cache hasn't been set up if (_projectSystemCache == null) { return; } _projectSystemCache.TryGetProjectNames(name, out var projectNames); // Remove the project from the cache _projectSystemCache.RemoveProject(name); if (!_projectSystemCache.ContainsKey(DefaultNuGetProjectName)) { DefaultNuGetProjectName = null; } // for LightSwitch project, the main project is not added to _projectCache, but it is called on removal. // in that case, projectName is null. if (projectNames != null && projectNames.CustomUniqueName.Equals(DefaultNuGetProjectName, StringComparison.OrdinalIgnoreCase) && !_projectSystemCache.IsAmbiguous(projectNames.ShortName)) { DefaultNuGetProjectName = projectNames.ShortName; } }