Skip to content

WIP: feat: support for NET Core 2.0 #95

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

alex-pollan
Copy link

@alex-pollan alex-pollan commented Dec 5, 2018

  • Now NsqSharp targets NET Framework 4.5 4.6.1+ and NET Standard 2.0
  • New project NsqSharp.WindowService targeting NET 4.5.1 4.6.1 to keep the BusService static class with support for Window Service, console app and host in IIS
  • Tests in a NET Core library
  • All examples reference NsqSharp (net 4.5 4.6.1)

To do:

  • Fix CI msbuild issue (Appveyor)
  • Generate breaking change version
  • Check assemblies signing
  • Review Nuget publish
  • Rename NsqSharp.WindowService?
  • Library for starting up the bus in for NET Core (hosted in Kestrel)?
  • Create at least one working NET Core example

<Name>NsqSharp</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="test-keys\cert.pem" />
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

???

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<None Include="test-keys\cert.pem" /> was moved up in the .csproj file. This is a TLS example project.


namespace NsqSharp.WindowService
{
public class WindowsBusConfiguration : BusConfiguration, IWindowsBusConfiguration
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Easiest way to implement IsConsoleMode

@@ -17,7 +17,11 @@ public class InterfaceBuilder
static InterfaceBuilder()
{
var assemblyName = new AssemblyName(Guid.NewGuid().ToString());
#if NETFULL
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Target dependent implementation

@@ -101,7 +105,7 @@ private static Type GetDynamicType(Type type)
typeBuilder.DefineMethodOverride(setAccessor, propertyInfo.GetSetMethod());
}

return typeBuilder.CreateType();
return typeBuilder.CreateTypeInfo();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New method supported in both platforms

@@ -28,7 +28,7 @@ public void IntnRange()
Assert.Throws<ArgumentOutOfRangeException>(() => _rng.Intn(-1));
}

[TestFixtureTearDown]
[OneTimeTearDown]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestFixtureTearDown is no deprecated in favor of OneTimeTearDown

@@ -66,7 +66,7 @@ public void AutofacContainerTest()
},
preCreateTopicsAndChannels: true);

BusService.Start(busConfiguration);
busConfiguration.StartBus();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these tests require this change now. BusService is not supported in NET Core/Standard

@judwhite
Copy link
Owner

Thanks @alex-pollan, I agree .NET Standard 2.0 is the way to go.

Since the Windows Service code will be pulled into another package now is a good time to look again at how that works. I'll do a major version bump of NsqSharp to account for the breaking change.

@judwhite
Copy link
Owner

@alex-pollan I'm also okay dropping support for any .NET less than 4.6.1 per the compatibility matrix https://docs.microsoft.com/en-us/dotnet/standard/net-standard. Users needing earlier .NET support can use 0.5.4 which has been battle tested in Production for quite some time.

@alex-pollan
Copy link
Author

@alex-pollan I'm also okay dropping support for any .NET less than 4.6.1 per the compatibility matrix https://docs.microsoft.com/en-us/dotnet/standard/net-standard. Users needing earlier .NET support can use 0.5.4 which has been battle tested in Production for quite some time.

Done, now it only supports 4.6.1+

@alex-pollan
Copy link
Author

@judwhite addressed your comments

@judwhite judwhite self-assigned this Sep 20, 2019
@Misiu
Copy link

Misiu commented Feb 18, 2021

@alex-pollan @judwhite any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants