Creating CppREST SDK NuGet Package Instruction
The following instructions include two parts: preparing binaries and creating NuGet package.The preparing binaries steps are required, follow the instructions precisely.
In the creaing NuGet package steps, you can choose either manually creating or using CoApp tool.
Preparing Binaries
- Copy the Casablanca\Binaries to \Casablanca\Release\nuget\Binaries.
- Copy the \Casablanca\Release\include to \Casablanca\Release\nuget\include.
- Running rename_stripped_pdbs.ps1 script to replace full symbols with stripped ones.
- Update the init.ps1 to correct version. (e.g. change cpprest2_1.natvis to cpprest2_2.natvis).
Manually Creating NuGet Package
- Update the cpprestsdk.nuspec to the correct version number.
<version>2.2.0</version> ... <file src="Binaries\Win32\Debug\cpprest120d_2_2.dll" target="\build\native\bin\Win32\v120\Debug\Desktop\cpprest120d_2_2.dll" />
- Update the cpprestsdk.targets with the correct version number.
<CppRestSDKVersionMajor>2</CppRestSDKVersionMajor> <CppRestSDKVersionMinor>2</CppRestSDKVersionMinor> <CppRestSDKVersionRevision>0</CppRestSDKVersionRevision>
- After finished all these steps, you can download the Nuget command utility, run the command under the directory where this cpprestsdk.nuspec created.
nuget.exe pack
Creating NuGet Package with CoApp
CoApp is a set of open source tools for building C/C++ NuGet packages for Windows. You can download and install the CoApp from here.- Open and edit the cpprestsdk.autopkg file to update the new version, release notes, description.
VER_WUNDERSCORE = 2_2;
- Make sure you have the latest CoApp tools, running following command from PowerShell:
Update-CoAppTools -KillPowershells
- Due to issues of CoApp tools, you need to modify the file C:\Program Files (x86)\Outercurve Foundation\Modules\CoApp\etc\PackageScriptTemplate.autopkg. Find the "bin += {" section and add the following line:
bin += { #add-each-file : { --> Items.ReferenceCopyLocalPaths; Items.CopyToOutput;
- Create new package by running:
Write-NuGetPackage .\cpprestsdk.autopkg -SplitThreshold 1000
- CoApp does not officially support phone8.1 yet, after creating the NuGet package, you need to install the Nuget package explorer. Open the cpprestsdk.2.2.0.nupkg with this explorer, edit the build\native\cpprestsdk.targets. Find the ItemGroup Label="ARM and v120_wp81 and Release and Phone8", remove or comment out the Deployment element.