File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
src/NuGet.Clients/NuGet.PackageManagement.VisualStudio/Projects Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -74,8 +74,9 @@ public async Task<NuGetProject> TryCreateNuGetProjectAsync(
7474 return null ;
7575 }
7676
77- // Check if the project is not CPS capable or if it is CPS capable then it does not have TargetFramework(s), if so then return false
78- if ( ! VsHierarchyUtility . IsCPSCapabilityComplaint ( hierarchy ) )
77+ // Check if the project is not CPS capable or if it is CPS capable that its opt'd in PackageReferences
78+ if ( ! VsHierarchyUtility . IsCPSCapabilityComplaint ( hierarchy ) &&
79+ ! VsHierarchyUtility . IsProjectCapabilityCompliant ( hierarchy ) )
7980 {
8081 return null ;
8182 }
@@ -84,20 +85,13 @@ public async Task<NuGetProject> TryCreateNuGetProjectAsync(
8485
8586 // read MSBuild property RestoreProjectStyle, TargetFramework, and TargetFrameworks
8687 var restoreProjectStyle = await buildProperties . GetPropertyValueAsync ( ProjectBuildProperties . RestoreProjectStyle ) ;
87- var targetFramework = await buildProperties . GetPropertyValueAsync ( ProjectBuildProperties . TargetFramework ) ;
88- var targetFrameworks = await buildProperties . GetPropertyValueAsync ( ProjectBuildProperties . TargetFrameworks ) ;
8988
9089 // check for RestoreProjectStyle property is set and if not set to PackageReference then return false
9190 if ( ! ( string . IsNullOrEmpty ( restoreProjectStyle ) ||
9291 restoreProjectStyle . Equals ( PackageReference , StringComparison . OrdinalIgnoreCase ) ) )
9392 {
9493 return null ;
9594 }
96- // check whether TargetFramework or TargetFrameworks property is set, else return false
97- else if ( string . IsNullOrEmpty ( targetFramework ) && string . IsNullOrEmpty ( targetFrameworks ) )
98- {
99- return null ;
100- }
10195
10296 var fullProjectPath = vsProject . FullProjectPath ;
10397 var unconfiguredProject = GetUnconfiguredProject ( vsProject . Project ) ;
You can’t perform that action at this time.
0 commit comments