Skip to content
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

Add .NET 8 TFM #1349

Merged
merged 3 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="1.1.0" Condition=" '$(TargetFramework)' == 'net461' " />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.0.0" Condition=" '$(TargetFramework)' == 'netstandard2.0' " />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" Condition=" '$(TargetFramework)' == 'net8.0' " />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="2.0.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.1" />
<PackageVersion Include="StructureMap" Version="4.6.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<IsShipping>true</IsShipping>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions
static Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions.AddJustSayingWithAwsConfig(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.Configuration.IConfiguration configuration, System.Action<JustSaying.MessagingBusBuilder, System.IServiceProvider> builderConfig) -> void
static Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions.AddJustSayingWithAwsConfig(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.Configuration.IConfiguration configuration, System.Action<JustSaying.MessagingBusBuilder> builderConfig) -> void
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IsShipping>true</IsShipping>
<RootNamespace>Microsoft.Extensions.DependencyInjection</RootNamespace>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net461;net8.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\JustSaying\JustSaying.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions
static Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions.AddJustSaying(this Microsoft.Extensions.DependencyInjection.IServiceCollection services) -> Microsoft.Extensions.DependencyInjection.IServiceCollection
static Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions.AddJustSaying(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string region) -> Microsoft.Extensions.DependencyInjection.IServiceCollection
static Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions.AddJustSaying(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action<JustSaying.MessagingBusBuilder, System.IServiceProvider> configure) -> Microsoft.Extensions.DependencyInjection.IServiceCollection
static Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions.AddJustSaying(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action<JustSaying.MessagingBusBuilder> configure) -> Microsoft.Extensions.DependencyInjection.IServiceCollection
static Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions.AddJustSayingHandler<TMessage, THandler>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services) -> Microsoft.Extensions.DependencyInjection.IServiceCollection
static Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions.AddJustSayingHandlers<TMessage>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Collections.Generic.IEnumerable<JustSaying.Messaging.MessageHandling.IHandlerAsync<TMessage>> handlers) -> Microsoft.Extensions.DependencyInjection.IServiceCollection
static Microsoft.Extensions.DependencyInjection.IServiceCollectionExtensions.ConfigureJustSaying(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.Action<JustSaying.MessagingBusBuilder> configure) -> Microsoft.Extensions.DependencyInjection.IServiceCollection
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<RootNamespace>StructureMap</RootNamespace>
<!-- StructureMap is not strong-named, so this assembly also cannot be -->
<SignAssembly>false</SignAssembly>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net461;net8.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\JustSaying\JustSaying.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
static StructureMap.ConfigurationExpressionExtensions.AddJustSaying(this StructureMap.ConfigurationExpression registry) -> void
static StructureMap.ConfigurationExpressionExtensions.AddJustSaying(this StructureMap.ConfigurationExpression registry, string region) -> void
static StructureMap.ConfigurationExpressionExtensions.AddJustSaying(this StructureMap.ConfigurationExpression registry, System.Action<JustSaying.MessagingBusBuilder, StructureMap.IContext> configure) -> void
static StructureMap.ConfigurationExpressionExtensions.AddJustSaying(this StructureMap.ConfigurationExpression registry, System.Action<JustSaying.MessagingBusBuilder> configure) -> void
static StructureMap.RegistryExtensions.AddJustSayingHandler<TMessage, THandler>(this StructureMap.Registry registry) -> void
StructureMap.ConfigurationExpressionExtensions
StructureMap.RegistryExtensions
2 changes: 1 addition & 1 deletion src/JustSaying.Models/JustSaying.Models.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsShipping>true</IsShipping>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net461;net8.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Using Remove="System.Net.Http" />
Expand Down
15 changes: 15 additions & 0 deletions src/JustSaying.Models/PublicAPI/net8.0/PublicAPI.Shipped.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
JustSaying.Models.Message
JustSaying.Models.Message.Conversation.get -> string
JustSaying.Models.Message.Conversation.set -> void
JustSaying.Models.Message.Id.get -> System.Guid
JustSaying.Models.Message.Id.set -> void
JustSaying.Models.Message.Message() -> void
JustSaying.Models.Message.RaisingComponent.get -> string
JustSaying.Models.Message.RaisingComponent.set -> void
JustSaying.Models.Message.SourceIp.get -> string
JustSaying.Models.Message.Tenant.get -> string
JustSaying.Models.Message.Tenant.set -> void
JustSaying.Models.Message.TimeStamp.get -> System.DateTime
JustSaying.Models.Message.TimeStamp.set -> void
JustSaying.Models.Message.Version.get -> string
virtual JustSaying.Models.Message.UniqueKey() -> string
Empty file.
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#if !NET8_0_OR_GREATER
using System.Runtime.Serialization;
#endif

namespace JustSaying.AwsTools.MessageHandling;

#if !NET8_0_OR_GREATER
[Serializable]
#endif
public class PublishException : Exception
{
public PublishException() : base("Failed to publish message")
Expand All @@ -17,7 +21,9 @@ public PublishException(string message, Exception inner) : base(message, inner)
{
}

#if !NET8_0_OR_GREATER
protected PublishException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
#endif
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#if !NET8_0_OR_GREATER
using System.Runtime.Serialization;
#endif

namespace JustSaying.AwsTools.QueueCreation;

#if !NET8_0_OR_GREATER
[Serializable]
#endif
public class ConfigurationErrorsException : Exception
{
public ConfigurationErrorsException() : base("Invalid configuration")
Expand All @@ -17,7 +21,9 @@ public ConfigurationErrorsException(string message, Exception inner) : base(mess
{
}

#if !NET8_0_OR_GREATER
protected ConfigurationErrorsException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
#endif
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#if !NET8_0_OR_GREATER
using System.Runtime.Serialization;
#endif

namespace JustSaying;

#if !NET8_0_OR_GREATER
[Serializable]
#endif
public class HandlerNotRegisteredWithContainerException : Exception
{
public HandlerNotRegisteredWithContainerException() : base("Handler not registered with container")
Expand All @@ -17,7 +21,9 @@ public HandlerNotRegisteredWithContainerException(string message, Exception inne
{
}

#if !NET8_0_OR_GREATER
protected HandlerNotRegisteredWithContainerException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
#endif
}
2 changes: 1 addition & 1 deletion src/JustSaying/JustSaying.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsShipping>true</IsShipping>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net461;net8.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\JustSaying.Models\JustSaying.Models.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#if !NET8_0_OR_GREATER
using System.Runtime.Serialization;
#endif

namespace JustSaying.Messaging.MessageSerialization;

#if !NET8_0_OR_GREATER
[Serializable]
#endif
public class MessageFormatNotSupportedException : Exception
{
public MessageFormatNotSupportedException() : base("Message format not supported")
Expand All @@ -17,7 +21,9 @@ public MessageFormatNotSupportedException(string message, Exception innerExcepti
{
}

#if !NET8_0_OR_GREATER
protected MessageFormatNotSupportedException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ namespace JustSaying.Messaging.MessageSerialization;
/// </summary>
public class SystemTextJsonSerializer : IMessageSerializer
{
private static readonly JsonSerializerOptions DefaultJsonSerializerOptions = new()
{
#if NET8_0_OR_GREATER
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
#else
IgnoreNullValues = true,
#endif
Converters =
{
new JsonStringEnumConverter(),
},
};

private readonly JsonSerializerOptions _options;

/// <summary>
Expand All @@ -26,17 +39,7 @@ public SystemTextJsonSerializer()
/// <param name="options">The optional <see cref="JsonSerializerOptions"/> to use.</param>
public SystemTextJsonSerializer(JsonSerializerOptions options)
{
if (options == null)
{
options = new JsonSerializerOptions
{
IgnoreNullValues = true
};

options.Converters.Add(new JsonStringEnumConverter());
}

_options = options;
_options = options ?? DefaultJsonSerializerOptions;
}

/// <inheritdoc />
Expand Down
Loading
Loading