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

Update to net462 as a minimum target #614

Merged
merged 6 commits into from
Apr 7, 2022
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
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ jobs:
- name: Test on .NET Core 3.1
run: dotnet test -c Release -f netcoreapp3.1 --no-build --no-restore -l "console;verbosity=detailed"

- name: Test on .NET Framework 4.6.1 (Windows only)
- name: Test on .NET Framework 4.6.2 (Windows only)
if: matrix.os == 'windows-latest'
run: dotnet test -c Release -f net461 --no-build --no-restore -l "console;verbosity=detailed"
run: dotnet test -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed"

- name: Test on .NET Framework 4.6.1 using Mono (Linux only)
- name: Test on .NET Framework 4.6.2 using Mono (Linux only)
if: matrix.os == 'ubuntu-latest'
run: |
docker run --rm -v "$PWD":'/project' -w='/project' mono:$MONO_TAG bash -c 'mono ./src/Castle.Core.Tests/bin/Release/net461/Castle.Core.Tests.exe && mono ./src/Castle.Core.Tests.WeakNamed/bin/Release/net461/Castle.Core.Tests.WeakNamed.exe'
docker run --rm -v "$PWD":'/project' -w='/project' mono:$MONO_TAG bash -c 'mono ./src/Castle.Core.Tests/bin/Release/net462/Castle.Core.Tests.exe && mono ./src/Castle.Core.Tests.WeakNamed/bin/Release/net462/Castle.Core.Tests.WeakNamed.exe'
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Bugfixes:
- Upgrade log4net to v2.0.13 (@jonorossi, @stakx, @dschwartzni, #574, #605)

Deprecations:
- Removed support for the .NET Framework < 4.5 and .NET Standard 1.x. (@stakx, #495, #496)
- Removed support for the .NET Framework < 4.6.2 and .NET Standard 1.x. (@stakx, #495, #496; @Jevonius, #614)
- Removed support for Code Access Security (CAS). (@stakx, #502)
- Removed support for Remoting. This library no longer defines any types deriving from `MarshalByRefObject`, and `ProxyUtil.IsProxy` (which used to recognize remoting/"transparent" proxies) now tests only for DynamicProxy proxies. (@stakx, #507)
- The following public members have been removed:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ build.cmd

Compilation requires a C# 9 compiler, an up-to-date .NET Core SDK, and MSBuild 15+ (which should be included in the former).

Running the unit tests additionally requires the .NET Framework 4.6.1+ as well as the .NET Core 2.1 and 3.1 runtimes to be installed. (If you do not have all of those installed, you can run the tests for a specific target framework using `dotnet test -f <framework>`.)
Running the unit tests additionally requires the .NET Framework 4.6.2+ as well as the .NET Core 2.1 and 3.1 runtimes to be installed. (If you do not have all of those installed, you can run the tests for a specific target framework using `dotnet test -f <framework>`.)

These requirements should be covered by Visual Studio 2019 and the .NET 5 SDK.

Expand All @@ -60,14 +60,14 @@ For known Mono defects, check [our issue tracker](https://github.com/castleproje

The following conditional compilation symbols (vertical) are currently defined for each of the build configurations (horizontal):

Symbol | .NET 4.5 | .NET Standard 2.x
Symbol | .NET 4.6.2 | .NET Standard 2.x
----------------------------------- | ------------------ | ------------------
`FEATURE_APPDOMAIN` | :white_check_mark: | :no_entry_sign:
`FEATURE_ASSEMBLYBUILDER_SAVE` | :white_check_mark: | :no_entry_sign:
`FEATURE_SERIALIZATION` | :white_check_mark: | :no_entry_sign:
`FEATURE_SYSTEM_CONFIGURATION` | :white_check_mark: | :no_entry_sign:
--- | |
`DOTNET45` | :white_check_mark: | :no_entry_sign:
`DOTNET462` | :white_check_mark: | :no_entry_sign:

* `FEATURE_APPDOMAIN` - enables support for features that make use of an AppDomain in the host.
* `FEATURE_ASSEMBLYBUILDER_SAVE` - enabled support for saving the dynamically generated proxy assembly.
Expand Down
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ echo "OSNAME: $OSNAME"
dotnet build --configuration Release || exit 1

echo --------------------
echo Running NET461 Tests
echo Running NET462 Tests
echo --------------------

mono ./src/Castle.Core.Tests/bin/Release/net461/Castle.Core.Tests.exe --result=DesktopClrTestResults.xml;format=nunit3
mono ./src/Castle.Core.Tests.WeakNamed/bin/Release/net461/Castle.Core.Tests.WeakNamed.exe --result=DesktopClrWeakNamedTestResults.xml;format=nunit3
mono ./src/Castle.Core.Tests/bin/Release/net462/Castle.Core.Tests.exe --result=DesktopClrTestResults.xml;format=nunit3
mono ./src/Castle.Core.Tests.WeakNamed/bin/Release/net462/Castle.Core.Tests.WeakNamed.exe --result=DesktopClrWeakNamedTestResults.xml;format=nunit3
jonorossi marked this conversation as resolved.
Show resolved Hide resolved

echo ---------------------------
echo Running NETCOREAPP3.1 Tests
Expand Down
6 changes: 3 additions & 3 deletions buildscripts/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ GOTO test
:test

echo --------------------
echo Running NET461 Tests
echo Running NET462 Tests
echo --------------------

%UserProfile%\.nuget\packages\nunit.consolerunner\3.11.1\tools\nunit3-console.exe src/Castle.Core.Tests/bin/%Configuration%/net461/Castle.Core.Tests.exe --result=DesktopClrTestResults.xml;format=nunit3 || exit /b 1
%UserProfile%\.nuget\packages\nunit.consolerunner\3.11.1\tools\nunit3-console.exe src/Castle.Core.Tests.WeakNamed/bin/%Configuration%/net461/Castle.Core.Tests.WeakNamed.exe --result=DesktopClrWeakNamedTestResults.xml;format=nunit3 || exit /b 1
%UserProfile%\.nuget\packages\nunit.consolerunner\3.11.1\tools\nunit3-console.exe src/Castle.Core.Tests/bin/%Configuration%/net462/Castle.Core.Tests.exe --result=DesktopClrTestResults.xml;format=nunit3 || exit /b 1
%UserProfile%\.nuget\packages\nunit.consolerunner\3.11.1\tools\nunit3-console.exe src/Castle.Core.Tests.WeakNamed/bin/%Configuration%/net462/Castle.Core.Tests.WeakNamed.exe --result=DesktopClrWeakNamedTestResults.xml;format=nunit3 || exit /b 1

echo ---------------------------
echo Running NETCOREAPP3.1 Tests
Expand Down
16 changes: 4 additions & 12 deletions buildscripts/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,12 @@
<DesktopClrConstants>TRACE;FEATURE_APPDOMAIN;FEATURE_ASSEMBLYBUILDER_SAVE;FEATURE_SERIALIZATION;FEATURE_SYSTEM_CONFIGURATION</DesktopClrConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)|$(Configuration)'=='net45|Debug'">
<DefineConstants>$(DiagnosticsConstants);$(DesktopClrConstants);DOTNET45</DefineConstants>
<PropertyGroup Condition="'$(TargetFramework)|$(Configuration)'=='net462|Debug'">
<DefineConstants>$(DiagnosticsConstants);$(DesktopClrConstants);DOTNET462</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)|$(Configuration)'=='net45|Release'">
<DefineConstants>$(DesktopClrConstants);DOTNET45;</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)|$(Configuration)'=='net461|Debug'">
<DefineConstants>$(DiagnosticsConstants);$(DesktopClrConstants);DOTNET45</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)|$(Configuration)'=='net461|Release'">
<DefineConstants>$(DesktopClrConstants);DOTNET45</DefineConstants>
<PropertyGroup Condition="'$(TargetFramework)|$(Configuration)'=='net462|Release'">
<DefineConstants>$(DesktopClrConstants);DOTNET462</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)|$(Configuration)'=='netstandard2.0|Debug'">
Expand Down
2 changes: 1 addition & 1 deletion docs/dynamicproxy-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DynamicProxy differs from the proxy implementation built into the CLR which requ
To use Castle DynamicProxy you need the following environment:

* one of the following runtimes installed
* .NET Framework 4.5+
* .NET Framework 4.6.2+
* .NET Core 2.1+
* any another .NET platform that supports .NET Standard 2.0+ and runtime type generation using System.Reflection.Emit
* `Castle.Core.dll` (assembly where DynamicProxy lives)
Expand Down
2 changes: 1 addition & 1 deletion ref/Castle.Core-net45.cs → ref/Castle.Core-net462.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/castleproject/Core")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(@"Castle.Core.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010077f5e87030dadccce6902c6adab7a987bd69cb5819991531f560785eacfc89b6fcddf6bb2a00743a7194e454c0273447fc6eec36474ba8e5a3823147d214298e4f9a631b1afee1a51ffeae4672d498f14b000e3d321453cdd8ac064de7e1cf4d222b7e81f54d4fd46725370d702a05b48738cc29d09228f1aa722ae1a9ca02fb")]
[assembly: System.Runtime.InteropServices.ComVisible(false)]
[assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.5", FrameworkDisplayName=".NET Framework 4.5")]
[assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName=".NET Framework 4.6.2")]
namespace Castle.Components.DictionaryAdapter
{
public abstract class AbstractDictionaryAdapter : System.Collections.ICollection, System.Collections.IDictionary, System.Collections.IEnumerable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[assembly: System.CLSCompliant(true)]
[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/castleproject/Core")]
[assembly: System.Runtime.InteropServices.ComVisible(false)]
[assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.5", FrameworkDisplayName=".NET Framework 4.5")]
[assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName=".NET Framework 4.6.2")]
namespace Castle.Services.Logging.NLogIntegration
{
public class ExtendedNLogFactory : Castle.Core.Logging.AbstractExtendedLoggerFactory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/castleproject/Core")]
[assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.5", FrameworkDisplayName=".NET Framework 4.5")]
[assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName=".NET Framework 4.6.2")]
namespace Castle.Services.Logging.SerilogIntegration
{
public class SerilogFactory : Castle.Core.Logging.AbstractLoggerFactory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[assembly: System.CLSCompliant(true)]
[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/castleproject/Core")]
[assembly: System.Runtime.InteropServices.ComVisible(false)]
[assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.5", FrameworkDisplayName=".NET Framework 4.5")]
[assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName=".NET Framework 4.6.2")]
namespace Castle.Services.Logging.Log4netIntegration
{
public class ExtendedLog4netFactory : Castle.Core.Logging.AbstractExtendedLoggerFactory
Expand Down
2 changes: 1 addition & 1 deletion src/Castle.Core.Tests.WeakNamed/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
</sources>
</system.diagnostics>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
</startup>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\buildscripts\common.props"></Import>

<PropertyGroup>
<TargetFrameworks>net461;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net462;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Castle.Core.Tests/Castle.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\buildscripts\common.props"></Import>

<PropertyGroup>
<TargetFrameworks>net461;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net462;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -63,7 +63,7 @@
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
<PackageReference Include="System.Net.Primitives" Version="4.3.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net461'">
<ItemGroup Condition="'$(TargetFramework)'=='net462'">
<PackageReference Include="PublicApiGenerator" Version="10.1.2" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/Castle.Core.Tests/PublicApiTestCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#if DOTNET45 // PublicApiGenerator requires .NET Standard 2.0, and we only need to run it once
#if DOTNET462 // PublicApiGenerator requires .NET Standard 2.0, and we only need to run it once

namespace Castle
{
Expand Down
2 changes: 1 addition & 1 deletion src/Castle.Core.Tests/config/netfx/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
</sources>
</system.diagnostics>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
</startup>
</configuration>
4 changes: 2 additions & 2 deletions src/Castle.Core/Castle.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\buildscripts\common.props"></Import>

<PropertyGroup>
<TargetFrameworks>net45;netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0;netstandard2.1</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -28,7 +28,7 @@
<EmbeddedResource Include="DynamicProxy\DynProxy.snk" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net45'">
<ItemGroup Condition="'$(TargetFramework)'=='net462'">
<Reference Include="System.Configuration" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\buildscripts\common.props"></Import>

<PropertyGroup>
<TargetFrameworks>net45;netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0;netstandard2.1</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\buildscripts\common.props"></Import>

<PropertyGroup>
<TargetFrameworks>net45;netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0;netstandard2.1</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\buildscripts\common.props"></Import>

<PropertyGroup>
<TargetFrameworks>net45;netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0;netstandard2.1</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net45</TargetFramework>
<TargetFramework>net462</TargetFramework>
<OutputPath>build\</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AssemblyName>nev</AssemblyName>
Expand Down