@@ -824,11 +824,11 @@ private void SendProjectBasedTelemetry(ProjectLaunchSettingsModel? launchSetting
824
824
{
825
825
Debug . Assert ( ProjectFileFullPath != null ) ;
826
826
var projectIdentifier = RunTelemetry . GetProjectBasedIdentifier ( ProjectFileFullPath , GetRepositoryRoot ( ) , Sha256Hasher . Hash ) ;
827
-
827
+
828
828
// Get package and project reference counts for project-based apps
829
829
int packageReferenceCount = 0 ;
830
830
int projectReferenceCount = 0 ;
831
-
831
+
832
832
// Try to get project information for telemetry if we built the project
833
833
if ( ShouldBuild )
834
834
{
@@ -837,10 +837,10 @@ private void SendProjectBasedTelemetry(ProjectLaunchSettingsModel? launchSetting
837
837
var globalProperties = MSBuildArgs . GlobalProperties ? . ToDictionary ( ) ?? new Dictionary < string , string > ( StringComparer . OrdinalIgnoreCase ) ;
838
838
globalProperties [ Constants . EnableDefaultItems ] = "false" ;
839
839
globalProperties [ Constants . MSBuildExtensionsPath ] = AppContext . BaseDirectory ;
840
-
840
+
841
841
using var collection = new ProjectCollection ( globalProperties : globalProperties ) ;
842
842
var project = collection . LoadProject ( ProjectFileFullPath ) . CreateProjectInstance ( ) ;
843
-
843
+
844
844
packageReferenceCount = RunTelemetry . CountPackageReferences ( project ) ;
845
845
projectReferenceCount = RunTelemetry . CountProjectReferences ( project ) ;
846
846
}
@@ -869,10 +869,10 @@ private void SendProjectBasedTelemetry(ProjectLaunchSettingsModel? launchSetting
869
869
{
870
870
try
871
871
{
872
- var currentDir = ProjectFileFullPath != null
872
+ var currentDir = ProjectFileFullPath != null
873
873
? Path . GetDirectoryName ( ProjectFileFullPath )
874
874
: Directory . GetCurrentDirectory ( ) ;
875
-
875
+
876
876
while ( currentDir != null )
877
877
{
878
878
if ( Directory . Exists ( Path . Combine ( currentDir , ".git" ) ) )
@@ -886,7 +886,7 @@ private void SendProjectBasedTelemetry(ProjectLaunchSettingsModel? launchSetting
886
886
{
887
887
// Ignore errors when trying to find repo root
888
888
}
889
-
889
+
890
890
return null ;
891
891
}
892
892
}
0 commit comments