how to update all the reference of a .net standard app's csproj of a specific package during installtion

Aditya Dalai 0 Reputation points

currently when I install a nuget package inside .net standard app i can only able update the PackageReference indie the csproj

<PackageReference Include="sip-si" Version="4.0.10" />

rest of all the referance are not able to update the updated version inside the same csproj file ex

  <Target Name="CopyReferenceDll" AfterTargets="Build">
	<Copy SourceFiles="..\..\_Common\packages\sip-si.4.0.9\lib\netstandard2.0\Wrapper.dll" DestinationFolder="$(TargetDir)" />
	<Copy SourceFiles="..\..\_Common\packages\sip-si.4.0.9\lib\netstandard2.0\Wrapper.pdb" DestinationFolder="$(TargetDir)" />

and it gives an error after installation and i need to update them manually is there any way to modify the sip-si.nuspec file so after installtion of the nuget pack the target section also will get updated with the particular version.

and can we run a powershell script during installation of a nuget package automatically

Microsoft Technologies based on the .NET software framework.
2,303 questions
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
9,456 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jiale Xue - MSFT 13,421 Reputation points Microsoft Vendor

    Hi @Aditya Dalai , Welcome to Microsoft Q&A,

    Microsoft employees said here that the powershell script of the package reference has been deprecated, and it is not recommended to use scripts in packages:

    The target after build target method you use can be tested here:

    User's image

    The principle is to replace the dll and pdb of the current project.

    If there is a problem, it may be because you did not choose to rebuild, so the previous metadata file is still used.

    Best Regards,


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments