@@ -18,6 +18,7 @@ internal static class NuGetConfigFile
1818 internal static bool TryWrite ( BuildContext context , DependenciesConfigurationFile dependenciesConfigurationFile , BuildConfiguration configuration )
1919 {
2020 var product = context . Product ;
21+ var console = context . Console ;
2122
2223 if ( ! product . GenerateNuGetConfig )
2324 {
@@ -87,6 +88,7 @@ internal static bool TryWrite( BuildContext context, DependenciesConfigurationFi
8788 // Add dependencies.
8889 foreach ( var dependencySource in dependenciesConfigurationFile . Dependencies )
8990 {
91+
9092 if ( dependencySource . Value . SourceKind == DependencySourceKind . Feed )
9193 {
9294 // Skip any feed dependency, so it will be fall back to the default package source.
@@ -102,19 +104,20 @@ internal static bool TryWrite( BuildContext context, DependenciesConfigurationFi
102104 }
103105
104106 var dependencyDefinition = product . GetDependencyDefinition ( dependencySource . Key ) ;
105- var parametrizedDependency = product . ParametrizedDependencies . SingleOrDefault ( d => d . Name == dependencySource . Key ) ;
106-
107- if ( parametrizedDependency == null )
108- {
109- context . Console . WriteWarning ( $ "Cannot find ParametrizedDependencies for { dependencySource . Key } ." ) ;
110-
111- continue ;
112- }
113-
114107 var dependencyDirectory = Path . GetDirectoryName ( dependencySource . Value . VersionFile ) ! ;
115108
116109 if ( dependencySource . Value . SourceKind == DependencySourceKind . Local )
117110 {
111+ var parametrizedDependency = product . ParametrizedDependencies . SingleOrDefault ( d => d . Name == dependencySource . Key ) ;
112+
113+ if ( parametrizedDependency == null )
114+ {
115+ // This case is not implemented.
116+ context . Console . WriteWarning ( $ "Cannot find ParametrizedDependencies for { dependencySource . Key } . Probably a transitive dependency." ) ;
117+
118+ continue ;
119+ }
120+
118121 dependencyDirectory = Path . Combine (
119122 dependencyDirectory ,
120123 dependencyDefinition . PrivateArtifactsDirectory . ToString (
0 commit comments