I am working on a VSTO application created with .NET framework 4.7.2. The solution contains multiple projects (.NET standard project) and recently we had to convert one project’s packages.config
file into a PackageReference
as we have to use Auth0 and GraphQL packages where one has dependencies to .NET core libries.
After simply right clicking on the related packages.config
file and converting it to PackageReference
went well without errors. We use GitHub actions to build the project and installer. After this change build failed in the build machine. When inspect the logs, identified that the issue is related to missing packages.
Do we need to do anything specific to the project after migrating to use the PackageReference
to avoid this build issue?
Found this article and added nuget.build.tasks.pack
nuget package to the project.
I tried migrating packages.config
files to PackageReference
for all the projects instead of the VSTO project in my solution. Added nuget.build.tasks.pack
to those projects. Ran the GitHub action. Still the build is failed on build machine (running well in my machine).
I tried migrating packages.config
files to PackageReference
for all the projects including the VSTO project in my solution. Then in VS debug time, I get this error, for the VSTO project.
The item
“C:Usersuser1.nugetpackagessystem.runtime.windowsruntime4.6.0buildTransitivenet461….refnetstandard2.0System.Runtime.WindowsRuntime.dll”
in item list “ReferencePath” does not define a value for metadata
“CopyLocal”. In order to use this metadata, either qualify it by
specifying %(ReferencePath.CopyLocal), or ensure that all items in
this list define a value for this metadata.
I tried clean build the solution, didn’t work. Also tried to find the System.Runtime.WindowsRuntime.dll in the VSTO project, was unable to find it.
So my questions are,
After migrating from packages.config to packageReference,
- Do we need to do the migration for all the projects?
- For fixing the build error, do we need to add any action step in the GitHub actions
.yml
file? - Running
msbuild -t:pack
on terminal is not working due to the “ReferencePath” does not define a value for metadata “CopyLocal” error. How to fix this error? If fixed it, will the GitHub action be a success?
Thank you in advance.