I am trying to add Hangfire to an existing ASP.NET v4.0 WebForms project and receiving the following error (in the Nuget installation log screen):
Install failed. Rolling back…
Could not install package ‘Hangfire.Core 1.1.1’. You are trying to install this package into a project that targets ‘.NETFramework,Version=v4.0’, but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
Points to note:
- The target project was initially based on .NET v3.5 and was migrated to v4.0 (more than 6 months ago).
- We do not have direct access to the internet on work PC, so I am downloading the Nuget packages and its dependencies for installation. Then I have setup an local folder as Nuget repository and installing from there.
- I have downloaded all the needed dependencies based on the “dependencies” list from the Nuget page, and based on the installation errors I received through the package manager log window.
And finally, I am not in a situation to use OWIN since I am planning to use Hangfire on a existing project without much changes. The purpose is mainly for the asyn report generation and storage of the same in database. It would be great if you can confirm if the following are the only things needed to be set in and WebForms project:
- Install package Hangfire.Core
- Install package Hangfire.SqlServer
- In Global.asax (Application_Start):
JobStorage.Current = new SqlServerStorage("connection string or its name");
- Follow the rest as in the user guide?