@@ -110,7 +110,7 @@ function getRestoredProjectName(
110
110
) ;
111
111
}
112
112
113
- export function extractLocalProjects ( libs : Record < string , any > ) : string [ ] {
113
+ function extractLocalProjects ( libs : Record < string , any > ) : string [ ] {
114
114
const localPackages : string [ ] = [ ] ;
115
115
116
116
for ( const [ key , value ] of Object . entries ( libs ) ) {
@@ -126,6 +126,10 @@ export function extractLocalProjects(libs: Record<string, any>): string[] {
126
126
return localPackages ;
127
127
}
128
128
129
+ function getDllName ( depName : string ) : string {
130
+ return `${ depName } .dll` ;
131
+ }
132
+
129
133
function buildGraph (
130
134
projectName : string ,
131
135
projectAssets : ProjectAssets ,
@@ -201,20 +205,33 @@ function buildGraph(
201
205
publishedProjectDeps . libraries ,
202
206
) ;
203
207
204
- // Overwriting the runtime versions with the versions declared in the manifest files.
205
208
const targets = publishedProjectDeps . targets [ runtimeTarget ] ;
209
+
210
+ // Overwriting the runtime versions with the values used in local projects.
206
211
for ( const pgkName of localPackagesNames ) {
207
212
if ( targets [ pgkName ] ?. dependencies ) {
208
213
for ( const [ key , value ] of Object . entries (
209
214
targets [ pgkName ] . dependencies ,
210
215
) ) {
211
- const dllName = ` ${ key } .dll` ;
216
+ const dllName = getDllName ( key ) ;
212
217
if ( runtimeAssembly [ dllName ] ) {
213
218
runtimeAssembly [ dllName ] = value as string ;
214
219
}
215
220
}
216
221
}
217
222
}
223
+
224
+ // Overwriting the runtime versions with the values used in fetched packages.
225
+ for ( const [ key , value ] of Object . entries ( targets ) ) {
226
+ if ( value && Object . keys ( value ) . length === 0 ) {
227
+ const [ depName , depVersion ] = key . split ( '/' ) ;
228
+ const dllName = getDllName ( depName ) ;
229
+ // NuGet’s dependency resolution mechanism will choose the higher available version.
230
+ if ( runtimeAssembly [ dllName ] && depVersion > runtimeAssembly [ dllName ] ) {
231
+ runtimeAssembly [ dllName ] = depVersion as string ;
232
+ }
233
+ }
234
+ }
218
235
}
219
236
220
237
recursivelyPopulateNodes (
0 commit comments