marcoCasamento / Hangfire.Redis.StackExchange

HangFire Redis storage based on original (and now unsupported) Hangfire.Redis but using lovely StackExchange.Redis client
Other
456 stars 109 forks source link

Migration to Visual Studio 2017 + Strong Named Project #48

Closed ryanelian closed 7 years ago

ryanelian commented 7 years ago

First, I would like to apologize for the sudden kraken pull request. However, I feel that upgrading to Visual Studio 2017 project is the way to go for these reasons:

In this solution, I have set up a Hangfire.Redis.StackExchange.StrongName project:

solutionexp

Rest assured that I have not broke anything, all the 83 tests still pass:

Build started, please wait...
Build completed.

Test run for E:\VS\Hangfire.Redis.StackExchange\Hangfire.Redis.Tests\bin\Debug\net452\Hangfire.Redis.Tests.dll(.NETFramework,Version=v4.5.2)
Microsoft (R) Test Execution Command Line Tool Version 15.0.0.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
[xUnit.net 00:00:00.3098017]   Discovering: Hangfire.Redis.Tests
[xUnit.net 00:00:00.4556363]   Discovered:  Hangfire.Redis.Tests
[xUnit.net 00:00:00.4634299]   Starting:    Hangfire.Redis.Tests
[xUnit.net 00:00:01.5157185]   Finished:    Hangfire.Redis.Tests

Total tests: 83. Passed: 83. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 1.8080 Seconds

Test run for E:\VS\Hangfire.Redis.StackExchange\Hangfire.Redis.Tests\bin\Debug\net46\Hangfire.Redis.Tests.dll(.NETFramework,Version=v4.6)
Microsoft (R) Test Execution Command Line Tool Version 15.0.0.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
[xUnit.net 00:00:00.3359314]   Discovering: Hangfire.Redis.Tests
[xUnit.net 00:00:00.4947518]   Discovered:  Hangfire.Redis.Tests
[xUnit.net 00:00:00.5016373]   Starting:    Hangfire.Redis.Tests
[xUnit.net 00:00:01.7641448]   Finished:    Hangfire.Redis.Tests

Total tests: 83. Passed: 83. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 2.0869 Seconds

Test run for E:\VS\Hangfire.Redis.StackExchange\Hangfire.Redis.Tests\bin\Debug\netcoreapp1.1\Hangfire.Redis.Tests.dll(.NETCoreApp,Version=v1.1)
Microsoft (R) Test Execution Command Line Tool Version 15.0.0.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
[xUnit.net 00:00:00.6470022]   Discovering: Hangfire.Redis.Tests
[xUnit.net 00:00:00.8475011]   Discovered:  Hangfire.Redis.Tests
[xUnit.net 00:00:00.8551448]   Starting:    Hangfire.Redis.Tests
[xUnit.net 00:00:01.6132223]   Finished:    Hangfire.Redis.Tests

Total tests: 83. Passed: 83. Failed: 0. Skipped: 0.
Test Run Successful.
Test execution time: 2.0999 Seconds

All left is probably set up the AppVeyor. (Choose Visual Studio 2017 build image, etc.)

If you simply wish to upload the packaged assemblies, I have uploaded it for you as well:

Hangfire.Redis.StackExchange.1.7.0-beta2.zip

Hangfire.Redis.StackExchange.StrongName.1.7.0-beta2.zip

I'm looking forward for the new packages on NuGet. Thank you in advance.

46

EDIT: Nevermind about Hangfire.Redis.StackExchange.StrongName. Apparently Hangfire.Core assembly is not strongly named. Caused crash when the application was loaded.

marcoCasamento commented 7 years ago

Thank you very much for your PR, I do agree with you, vs2017 upgrade ease the development. I'm in a very, very busy time by now (my first daughter has born some days ago) but I believe I'll be able to merge the PR, adapt AppVeyor and upload the new package by the end of the week. I think it's better to let AppVeyor build the binaries.

Il 02 mag 2017 5:32 AM, "Ryan Elian" notifications@github.com ha scritto:

First, I would like to apologize for the sudden kraken pull request. However, I feel that upgrading to Visual Studio 2017 project is the way to go for these reasons:

-

More mature toolings, compared to buggy project.json. (Not 'preview' tools, faster, less crash, etc.)

Integrated MSBuild makes package management and strong-name signing a breeze, as it allows the merge of xproj + project.json + nuspec files.

Sooner or later you will need to upgrade to this project format anyway. Might as well do it now.

In this solution, I have set up a Hangfire.Redis.StackExchange.StrongName project:

[image: solutionexp] https://cloud.githubusercontent.com/assets/8892187/25602921/9c60494e-2f21-11e7-8361-1085df2fc615.PNG

-

It links (not copy) the file from Hangfire.Redis.StackExchange, so you don't need to maintain two different source files.

It has Hangfire_Redis_StackExchange.snk, set to sign the assembly and create NuGet package immediately upon compilation, without you needing to do so manually.

None of the C# source files are changed. I wouldn't dare.

Rest assured that I have not broke anything, all the 83 tests still pass:

Build started, please wait... Build completed.

Test run for E:\VS\Hangfire.Redis.StackExchange\Hangfire.Redis.Tests\bin\Debug\net452\Hangfire.Redis.Tests.dll(.NETFramework,Version=v4.5.2) Microsoft (R) Test Execution Command Line Tool Version 15.0.0.0 Copyright (c) Microsoft Corporation. All rights reserved.

Starting test execution, please wait... [xUnit.net 00:00:00.3098017] Discovering: Hangfire.Redis.Tests [xUnit.net 00:00:00.4556363] Discovered: Hangfire.Redis.Tests [xUnit.net 00:00:00.4634299] Starting: Hangfire.Redis.Tests [xUnit.net 00:00:01.5157185] Finished: Hangfire.Redis.Tests

Total tests: 83. Passed: 83. Failed: 0. Skipped: 0. Test Run Successful. Test execution time: 1.8080 Seconds

Test run for E:\VS\Hangfire.Redis.StackExchange\Hangfire.Redis.Tests\bin\Debug\net46\Hangfire.Redis.Tests.dll(.NETFramework,Version=v4.6) Microsoft (R) Test Execution Command Line Tool Version 15.0.0.0 Copyright (c) Microsoft Corporation. All rights reserved.

Starting test execution, please wait... [xUnit.net 00:00:00.3359314] Discovering: Hangfire.Redis.Tests [xUnit.net 00:00:00.4947518] Discovered: Hangfire.Redis.Tests [xUnit.net 00:00:00.5016373] Starting: Hangfire.Redis.Tests [xUnit.net 00:00:01.7641448] Finished: Hangfire.Redis.Tests

Total tests: 83. Passed: 83. Failed: 0. Skipped: 0. Test Run Successful. Test execution time: 2.0869 Seconds

Test run for E:\VS\Hangfire.Redis.StackExchange\Hangfire.Redis.Tests\bin\Debug\netcoreapp1.1\Hangfire.Redis.Tests.dll(.NETCoreApp,Version=v1.1) Microsoft (R) Test Execution Command Line Tool Version 15.0.0.0 Copyright (c) Microsoft Corporation. All rights reserved.

Starting test execution, please wait... [xUnit.net 00:00:00.6470022] Discovering: Hangfire.Redis.Tests [xUnit.net 00:00:00.8475011] Discovered: Hangfire.Redis.Tests [xUnit.net 00:00:00.8551448] Starting: Hangfire.Redis.Tests [xUnit.net 00:00:01.6132223] Finished: Hangfire.Redis.Tests

Total tests: 83. Passed: 83. Failed: 0. Skipped: 0. Test Run Successful. Test execution time: 2.0999 Seconds

All left is probably set up the AppVeyor. (Choose Visual Studio 2017 build image, etc.)

If you simply wish to upload the packaged assemblies, I have uploaded it for you as well:

Hangfire.Redis.StackExchange.1.7.0-beta2.zip https://github.com/marcoCasamento/Hangfire.Redis.StackExchange/files/969329/Hangfire.Redis.StackExchange.1.7.0-beta2.zip

Hangfire.Redis.StackExchange.StrongName.1.7.0-beta2.zip https://github.com/marcoCasamento/Hangfire.Redis.StackExchange/files/969327/Hangfire.Redis.StackExchange.StrongName.1.7.0-beta2.zip

I'm looking forward for the new packages on NuGet. Thank you in advance.

46

https://github.com/marcoCasamento/Hangfire.Redis.StackExchange/issues/46

You can view, comment on, or merge this pull request online at:

https://github.com/marcoCasamento/Hangfire.Redis.StackExchange/pull/48 Commit Summary

  • Visual Studio 2017 project migration.
  • Strong named project + key.

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/marcoCasamento/Hangfire.Redis.StackExchange/pull/48, or mute the thread https://github.com/notifications/unsubscribe-auth/AANtY7TfFgP9ou0GcZSGLbkTTcdUxvOlks5r1qPUgaJpZM4NNrJJ .

ryanelian commented 7 years ago

Hiya. Congratulations on you first daughter!

I'm glad we're on the same page about VS 2017. For that reason, I will reopen the PR.

However, I think the Hangfire.Redis.StackExchange.StrongName assembly won't work unless Hangfire.Core dependency becomes strongly-named as well. So you might want to postpone uploading the strongly-named package until it (if ever) becomes strongly named as well...

... Which brings me to a suggestion. Due to Microsoft.Extensions.Caching.Redis (crucial for ASP.NET Core MVC Redis session) depending on StackExchange.Redis.StrongName, maybe we can do one of the action below to enable this library being used alongside that package:

  1. Creating an alternate package Hangfire.Redis.StackExchange.Alternative that depends on StackExchange.Redis.StrongName instead of StackExchange.Redis.

  2. Insist on uploading the Hangfire.Redis.StackExchange.StrongName package but do not sign it. While this is misleading and may upset people who want a strongly named package of this project, it enables it to be used alongside Microsoft.Extensions.Caching.Redis for now. (At the same time, reserving the package name in nuget.org)

  3. Change the dependency of Hangfire.Redis.StackExchange itself to StackExchange.Redis.StrongName.

What do you think?