@@ -144,6 +144,25 @@ export class ArtifactManager {
144144 }
145145 this . logging . log ( 'Total project references: ' + projects . length )
146146
147+ let packages : string [ ] = [ ]
148+ if ( request . PackageReferences != null ) {
149+ for ( const pkg of request . PackageReferences ) {
150+ if ( ! pkg . NetCompatiblePackageFilePath ) {
151+ continue
152+ }
153+ try {
154+ const packageRelativePath = this . normalizePackageFileRelativePath ( pkg . NetCompatiblePackageFilePath )
155+ packages . push ( packageRelativePath )
156+ await this . copyFile (
157+ pkg . NetCompatiblePackageFilePath ,
158+ this . getWorkspaceReferencePathFromRelativePath ( packageRelativePath )
159+ )
160+ } catch ( error ) {
161+ this . logging . log ( 'Failed to process package file: ' + error + pkg . NetCompatiblePackageFilePath )
162+ }
163+ }
164+ }
165+
147166 return {
148167 EntryPath : this . normalizeSourceFileRelativePath ( request . SolutionRootPath , request . SelectedProjectPath ) ,
149168 SolutionPath : this . normalizeSourceFileRelativePath ( request . SolutionRootPath , request . SolutionFilePath ) ,
@@ -152,6 +171,7 @@ export class ArtifactManager {
152171 ...( request . EnableRazorViewTransform !== undefined && {
153172 EnableRazorViewTransform : request . EnableRazorViewTransform ,
154173 } ) ,
174+ Packages : packages ,
155175 } as RequirementJson
156176 }
157177
@@ -240,6 +260,10 @@ export class ArtifactManager {
240260 : relativePath . toLowerCase ( )
241261 }
242262
263+ normalizePackageFileRelativePath ( packageFilePath : string ) : string {
264+ return path . join ( packagesFolderName , path . basename ( packageFilePath ) ) . toLowerCase ( )
265+ }
266+
243267 zipDirectory ( sourceDir : string , outPath : string ) {
244268 const archive = archiver ( 'zip' , { zlib : { level : 9 } } )
245269 const stream = fs . createWriteStream ( outPath )
0 commit comments