ASP.NET WebHooks Preview Nuget Package Install Script

Truth be told – I haven’t done a lot of ASP.NET dev over the last couple of years, but since I do a good amount of maker projects that involve webhooks, I had to checkout the new ASP.NET WebHooks feature.

I went to install the Nuget packages recommended by this article and got this error:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Install-Package : Failed to add reference to 'System.IO'. Please make sure that it is in the Global Assembly Cache.
At C:\users\jong\documents\visual studio 2015\Projects\webhookstest1\nuget-install.ps1:2 char:1
Install-Package Microsoft.AspNet.WebHooks.Custom.AzureStorage -Includ …
~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Install failed. Rolling back…
Package 'Microsoft.AspNet.DataProtection 1.0.0-beta6' does not exist in project 'webhookstest1'

It could have surfaced via the following exception as well:

1
2
Error CS1061 'HttpConfiguration' does not contain a definition for 'InitializeCustomWebHooksAzureStorage' and no extension method 'InitializeCustomWebHooksAzureStorage' accepting a first argument of type 'HttpConfiguration' could be found (are you missing a using directive or an assembly reference?)
WebApplication4 c:\users\jong\documents\visual studio 2015\Projects\WebApplication4\WebApplication4\App_Start\WebApiConfig.cs 24

It looks like Microsoft.AspNet.DataProtection is also required. I created a gist that includes all the dependencies you need.

Just copy that ps1 file to your solution folder and run it in the Package Manager Console

Hope this help

Jon

Share