Skip to content

Commit

Permalink
#371 Upgrade to .NET 5.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjstone committed Nov 17, 2020
1 parent cc634e0 commit 59889b5
Show file tree
Hide file tree
Showing 62 changed files with 200 additions and 191 deletions.
2 changes: 1 addition & 1 deletion doc/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
{
"dest": "api",
"properties": {
"TargetFramework": "netstandard2.1"
"TargetFramework": "net5.0"
},
"src": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.8" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RapidField.SolidInstruments.Example.Domain\RapidField.SolidInstruments.Example.Domain.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.8" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RapidField.SolidInstruments.Example.Domain.AccessControl\RapidField.SolidInstruments.Example.Domain.AccessControl.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
<Product>Solid Instruments</Product>
<Description>This project demonstrates AccessControl domain logic utilizing the Solid Instruments data access and messaging constructs.</Description>
<Version>$(BuildVersion)</Version>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>latest</LangVersion>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\netstandard2.1\RapidField.SolidInstruments.Example.Domain.AccessControl.xml</DocumentationFile>
<DocumentationFile>bin\Debug\net5.0\RapidField.SolidInstruments.Example.Domain.AccessControl.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard2.1\RapidField.SolidInstruments.Example.Domain.AccessControl.xml</DocumentationFile>
<DocumentationFile>bin\Release\net5.0\RapidField.SolidInstruments.Example.Domain.AccessControl.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.8" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RapidField.SolidInstruments.Example.Domain.Identity\RapidField.SolidInstruments.Example.Domain.Identity.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
<Product>Solid Instruments</Product>
<Description>This project demonstrates Identity domain logic utilizing the Solid Instruments data access and messaging constructs.</Description>
<Version>$(BuildVersion)</Version>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>latest</LangVersion>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\netstandard2.1\RapidField.SolidInstruments.Example.Domain.Identity.xml</DocumentationFile>
<DocumentationFile>bin\Debug\net5.0\RapidField.SolidInstruments.Example.Domain.Identity.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard2.1\RapidField.SolidInstruments.Example.Domain.Identity.xml</DocumentationFile>
<DocumentationFile>bin\Release\net5.0\RapidField.SolidInstruments.Example.Domain.Identity.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
</PropertyGroup>
<ItemGroup>
<Content Include="..\..\LICENSE.txt" Link="LICENSE.txt" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.8" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\RapidField.SolidInstruments.DataAccess.DotNetNative.Ef\RapidField.SolidInstruments.DataAccess.DotNetNative.Ef.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
<Product>Solid Instruments</Product>
<Description>This project houses a sample collection of shared domain models that utilize the Solid Instruments messaging constructs.</Description>
<Version>$(BuildVersion)</Version>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>latest</LangVersion>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\netstandard2.1\RapidField.SolidInstruments.Example.Domain.xml</DocumentationFile>
<DocumentationFile>bin\Debug\net5.0\RapidField.SolidInstruments.Example.Domain.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<Optimize>false</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard2.1\RapidField.SolidInstruments.Example.Domain.xml</DocumentationFile>
<DocumentationFile>bin\Release\net5.0\RapidField.SolidInstruments.Example.Domain.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
<Product>Solid Instruments</Product>
<Description>This library exposes useful collection types and features, including: circular buffers, infinite sequences, pinned memory, tree composition and traversal.</Description>
<Version>$(BuildVersion)</Version>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>latest</LangVersion>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/rapidfield/solid-instruments</RepositoryUrl>
Expand All @@ -24,12 +24,12 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
<EnableNETAnalyzers>true</EnableNETAnalyzers>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\netstandard2.1\RapidField.SolidInstruments.Collections.xml</DocumentationFile>
<DocumentationFile>bin\Debug\net5.0\RapidField.SolidInstruments.Collections.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard2.1\RapidField.SolidInstruments.Collections.xml</DocumentationFile>
<DocumentationFile>bin\Release\net5.0\RapidField.SolidInstruments.Collections.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public ReadOnlyPinnedMemory(T[] field)
{
Handle = GCHandle.Alloc(field.RejectIf().IsNull(nameof(field)).TargetArgument, GCHandleType.Pinned);
Field = (T[])Handle.Target;
HandleIsActive = true;
LazyFieldMemory = new Lazy<Memory<T>>(InitializeFieldMemory, LazyThreadSafetyMode.ExecutionAndPublication);
Length = field.Length;
Pointer = Handle.AddrOfPinnedObject();
Expand Down Expand Up @@ -210,7 +211,12 @@ protected override void Dispose(Boolean disposing)
{
if (IsDisposed == false)
{
Handle.Free();
if (HandleIsActive)
{
HandleIsActive = false;
Handle.Free();
}

Pointer = IntPtr.Zero;
}
}
Expand Down Expand Up @@ -294,5 +300,11 @@ public ReadOnlySpan<T> ReadOnlySpan
/// </summary>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private readonly Lazy<Memory<T>> LazyFieldMemory;

/// <summary>
/// Represents a value indicating whether or not <see cref="Handle" /> is initialized and active.
/// </summary>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private Boolean HandleIsActive = false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
<Product>Solid Instruments</Product>
<Description>This library exposes the Autofac IoC integration for the Solid Instruments implementations of the command and mediator patterns.</Description>
<Version>$(BuildVersion)</Version>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>latest</LangVersion>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/rapidfield/solid-instruments</RepositoryUrl>
Expand All @@ -24,12 +24,12 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
<EnableNETAnalyzers>true</EnableNETAnalyzers>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\netstandard2.1\RapidField.SolidInstruments.Command.Autofac.xml</DocumentationFile>
<DocumentationFile>bin\Debug\net5.0\RapidField.SolidInstruments.Command.Autofac.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard2.1\RapidField.SolidInstruments.Command.Autofac.xml</DocumentationFile>
<DocumentationFile>bin\Release\net5.0\RapidField.SolidInstruments.Command.Autofac.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
</PropertyGroup>
Expand All @@ -41,7 +41,7 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
<ItemGroup>
<PackageReference Include="Autofac" Version="6.0.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.8" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RapidField.SolidInstruments.Command\RapidField.SolidInstruments.Command.csproj" Version="$(BuildVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
<Product>Solid Instruments</Product>
<Description>This library exposes the native .NET IoC integration for the Solid Instruments implementations of the command and mediator patterns.</Description>
<Version>$(BuildVersion)</Version>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>latest</LangVersion>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/rapidfield/solid-instruments</RepositoryUrl>
Expand All @@ -24,12 +24,12 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
<EnableNETAnalyzers>true</EnableNETAnalyzers>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\netstandard2.1\RapidField.SolidInstruments.Command.Autofac.xml</DocumentationFile>
<DocumentationFile>bin\Debug\net5.0\RapidField.SolidInstruments.Command.Autofac.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard2.1\RapidField.SolidInstruments.Command.Autofac.xml</DocumentationFile>
<DocumentationFile>bin\Release\net5.0\RapidField.SolidInstruments.Command.Autofac.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
</PropertyGroup>
Expand All @@ -39,9 +39,9 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
<Content Include="..\..\LICENSE.txt" Link="LICENSE.txt" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.8" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.8" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.8" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RapidField.SolidInstruments.Command\RapidField.SolidInstruments.Command.csproj" Version="$(BuildVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
<Product>Solid Instruments</Product>
<Description>This library exposes implementations of the command and mediator patterns.</Description>
<Version>$(BuildVersion)</Version>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>latest</LangVersion>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/rapidfield/solid-instruments</RepositoryUrl>
Expand All @@ -24,12 +24,12 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
<EnableNETAnalyzers>true</EnableNETAnalyzers>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\netstandard2.1\RapidField.SolidInstruments.Command.xml</DocumentationFile>
<DocumentationFile>bin\Debug\net5.0\RapidField.SolidInstruments.Command.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard2.1\RapidField.SolidInstruments.Command.xml</DocumentationFile>
<DocumentationFile>bin\Release\net5.0\RapidField.SolidInstruments.Command.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ protected virtual void Dispose(Boolean disposing)
return;
}

lock (DisposalSyncRoot)
lock (DisposalSyncRoot ?? new Object())
{
if (IsDisposed)
{
Expand Down
4 changes: 2 additions & 2 deletions src/RapidField.SolidInstruments.Core/Instrument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void Dispose()
return;
}

lock (DisposalSyncRoot)
lock (DisposalSyncRoot ?? new Object())
{
if (IsDisposedOrDisposing)
{
Expand Down Expand Up @@ -174,7 +174,7 @@ protected void RejectIfDisposed()
/// <summary>
/// Gets a concurrency control mechanism that is used to manage state for the current <see cref="Instrument" />.
/// </summary>
protected internal IConcurrencyControl StateControl => LazyStateControl.Value;
protected internal IConcurrencyControl StateControl => LazyStateControl?.Value ?? new UnconstrainedControl();

/// <summary>
/// Gets a value indicating whether or not the current <see cref="Instrument" /> has been disposed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
<Product>Solid Instruments</Product>
<Description>This library exposes foundational, general-purpose features, including: concurrency control abstractions, configurable types, fluent argument validation and object lifetime management.</Description>
<Version>$(BuildVersion)</Version>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>latest</LangVersion>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/rapidfield/solid-instruments</RepositoryUrl>
Expand All @@ -24,13 +24,13 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\netstandard2.1\RapidField.SolidInstruments.Core.xml</DocumentationFile>
<DocumentationFile>bin\Debug\net5.0\RapidField.SolidInstruments.Core.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard2.1\RapidField.SolidInstruments.Core.xml</DocumentationFile>
<DocumentationFile>bin\Release\net5.0\RapidField.SolidInstruments.Core.xml</DocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
</PropertyGroup>
Expand All @@ -40,6 +40,6 @@ Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in
<Content Include="..\..\LICENSE.txt" Link="LICENSE.txt" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.8" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
</ItemGroup>
</Project>
Loading

0 comments on commit 59889b5

Please sign in to comment.