How to manually re-create a nuget package ?
Issue Overview : There are some use cases, in which it becomes necessary to manually create a Nuget package from a pre-existing package. Usually this solution is used as a work around for getting past a dependency conflict that needs to be fixed by a Jira.
An example : If the UiPath.WebAPI.Activities 1.4.4 is used with the package UiPathTeams.Documents.TDDGenerator 1.4.7221.18964, the UiPathTeams.Documents.TDDGenerator uses NewtonSoft.json.dll version 12.03 but this version of NewtonSoft.json.dll is not compatible with UiPath.WebAPI.Activities 1.4.4.
In the above example, the dependency conflict can be circumvented by republishing the UiPathTeams.Documents.TDDGenerator with NewtonSoft.json.dll version 11.02.
To create the new package, perform the below:
- For this example we will be repackaging the UiPathTeams.Documents.TDDGenerator with NewtonSoft.json.dll version 11.02
- First, get a copy of the package. If the package has been used in a workflow, it can probably be found at %userprofile%\.nuget\packages\. Within the package directory, there will be a .nupkg for the package that needs to be modified.
- In this case the folder in question is located at: %userprofile%\.nuget\packages\uipathteam.documents.tddgenerator\1.4.7221.18964\uipathteam.documents.tddgenerator.1.4.7221.18964.nupkg
- The file can also be downloaded from UiPath Go.
- Copy this file to a working directory.
- In the working directory, change the file extension to “.zip” and then unpack it. This should create the following directory with the package contents: <working directory>\<package name and version>
- In this case this would be: <working directory>\uipathteam.documents.tddgenerator.1.4.7221.18964
- Open the directory and delete the following folders/files:
- All that should remain is the “lib” folder and the “.nuspec” file.
- Open the .nuspec file
- Change the version of the package to the new package version. In this case, we would recommend change the version to something lower than the official version. This will prevent the package from being used in place of a future release.
- In our example, change the version to 1.4.7221.3000
- The version tag will be: <version>1.4.7221.18964</version>
- Change it to: <version>1.4.7221.3000</version>
- Save the file
- For our example, the NewtonSoft.json.dll file needs to be replaced with version 11.02
- Version 11.02 can probably be found at: %userprofile%\.nuget\packages\newtonsoft.json\11.0.2\lib\net45\Newtonsoft.Json.dll
- Copy this file and replace the one located at <working directory>\ uipathteam.documents.tddgenerator.1.4.7221.18964\lib\net461\Newtonsoft.Json.dll
- Make sure that nuget.exe is installed. If it is not installed, it can be downloaded from: https://www.nuget.org/downloads
- One the nuget.exe is downloaded it can be placed in C:\Windows\System32 or it can stay in the download folder. But if it is in the download folder, that path to the download folder needs to be specified when invoking the executable.
- Open a command prompt and change directories to the working directory.
- cd <working directory>
- Run the following command:
- Nuget.exe pack uipathteam.documents.tddgenerator.1.4.7221.18964
- If the nuget.exe was left in the downloads folder, it needs to be referenced as: <download folder>\nuget.exe
- This command will create the package. Try uploading it to Orchestrator.