-
Notifications
You must be signed in to change notification settings - Fork 1.7k
.NET Core support for Hangfire #604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To reduce the number of conditional defines
To not to include the file to the PR diff.
NCrontab doesn't support .NET Standard yet, giving us compile-time errors.
"imports": "portable-netcore45" doesn't work correctly and lead to compile-time errors under MSBuild command line.
With new default interval it runs for 30 seconds
This enables more natural workflow with using the same files without generating huge number of links.
A lot of files were changed, and I don't want to see unnecessary changes in a PR diff.
* Recurring jobs are uncommented * NCrontab source code is added for .NET Core
Now it is fully optional and isn't required to be unique, as GUID is automatically appended. This step was made to remove the System.Diagnostics.Process dependency from .NET Core version.
This was referenced Jul 5, 2016
Just to ensure all is working fine. As we know from commit 816d85c, order matters ;-)
* CI Build versions now use "1.6.0-00324" scheme, without the "build" word to be correctly compared to -alpha and -beta releases. * Some common psake functions were moved to Hangfire.Build.
This was referenced Jul 12, 2016
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
.NET Core support for Hangfire is here. The following projects that target .NET Standard 1.3 were added to the solution. I've tried
xproj
-based approach, but it is still weird and requires to change every aspect of a building pipeline. So I decided to end up with the portable projects..NET Core support is currently experimental, since there no unit tests that cover the .NET Standard target – not all the required dependencies are ported to .NET Core, including Moq (that requires Castle.Core, which NuGet package for .NET Core is broken currently). However, looks like it's working, at least on Windows.
A lot of dependencies are still in alpha or beta versions, so the final release will be available only when they are ready:
Changes
There are no breaking changes for Hangfire on .NET 4.5. Consider .NET Core support as an add-on. However, some members became obsolete, but they will be removed only in 2.0.0, so you can use them for a while.
OWIN
, such asIRequestDispatcher
andRequestDispatcherContext
types, became obsolete.DashboardOptions.AuthorizationFilters
as well asIAuthorizationFilter
interface are obsolete. UseIDashboardAuthorizationFilter
interface andDashboardOptions.Authorization
property instead.Hangfire.Core.NetStandard
CronExpressionDescriptor
support was dropped, as no ILMerge available yet.DisplayNameAttribute
support is not available yet.EntLibLogProvider
,LoupeLogProvider
andElmahLogProvider
were not ported (yet).Hangfire.SqlServer.NetStandard
TransactionScope
-based transactions were replaced withDbTransaction
(IPersistentJobQueue
was changed to support this).Hangfire.AspNetCore
IApplicationBuilder
andIServiceCollection
extension methods that allow to configure Hangfire with ease.AspNetCoreJobActivator
that integrates with ASP.NET Core dependency injection system and knows what to do with scopes.AspNetCoreLogProvider
that integrate Hangfire with ASP.NET Core logging subsystem.How to use
Hangfire
,Hangfire.Core
,Hangfire.SqlServer
andHangfire.AspNetCore
packages are already available on NuGet. They contain assemblies for both full .NET and .NET Core environments. So you can install them and play with Hangfire on .NET Core.Installation is simple, as always. All you need is only to reference the special version
1.6.0-build-02111
in yourproject.json
file:And configure your
Startup
class a bit:Closes #591, #476, #365 and #267.