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

Fix broken Linux CI build on Appveyor #496

Merged
merged 8 commits into from
May 6, 2020
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Castle Core Changelog

## Unreleased

Deprecations:
- Removed support for the .NET Framework 3.5.
stakx marked this conversation as resolved.
Show resolved Hide resolved

## 4.4.1 (2020-05-06)

Bugfixes:
Expand Down
65 changes: 32 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Browse the [contributing section](https://github.com/castleproject/Home#its-comm
build.cmd
```

Compilation requires an up-to-date .NET Core SDK, MSBuild 15+ (which should be included in the former), and reference assemblies for the .NET Framework versions 3.5, 4.0, and 4.5.
Compilation requires 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 1.1 runtime to be installed.

Expand All @@ -46,9 +46,9 @@ Most of these requirements should be covered by Visual Studio 2017.
./build.sh
```

Compilation requires an up-to-date .NET Core SDK, as well as Mono for the .NET Framework reference assemblies. We recommend Mono 5.10+, though older versions (4.6.1+) might still work as well.
Compilation requires an up-to-date .NET Core SDK.

Running the unit tests additionally requires the .NET Core 1.1 runtime to be installed.
Running the unit tests additionally requires the .NET Core 1.1 runtime to be installed, as well as either Docker or Mono. For the latter, we recommend Mono 5.10+, though older versions (4.6.1+) might still work as well.

:information_source: **Mono runtime support:** Castle Core runs with minor limitations and defects on Mono 4.0.2+ (however 4.6.1+ is highly recommended, or 5.10+ if your code uses new C# 7.x language features such as `in` parameters).

Expand All @@ -60,35 +60,34 @@ 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 | NET35 | NET40 | NET45 | .NET Core
----------------------------------- | ------------------ | ------------------ | ------------------ | ------------------
`FEATURE_APPDOMAIN` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_ASSEMBLYBUILDER_SAVE` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_BINDINGLIST` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_DICTIONARYADAPTER_XML` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_CUSTOMMODIFIERS` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_EVENTLOG` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_GAC` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_GET_REFERENCED_ASSEMBLIES` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_IDATAERRORINFO` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_ISUPPORTINITIALIZE` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_LEGACY_REFLECTION_API` | :white_check_mark: | :white_check_mark: | :no_entry_sign: | :no_entry_sign:
`FEATURE_LISTSORT` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_NETCORE_REFLECTION_API` | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :white_check_mark:
`FEATURE_REMOTING` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_SECURITY_PERMISSIONS` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_SERIALIZATION` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_SMTP` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_SYSTEM_CONFIGURATION` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_TARGETEXCEPTION` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_TEST_COM` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_TEST_DATASET` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_TEST_PEVERIFY` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_TEST_SERILOGINTEGRATION` | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :white_check_mark:
--- | | | |
`DOTNET35` | :white_check_mark: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign:
`DOTNET40` | :no_entry_sign: | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`DOTNET45` | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :no_entry_sign:
Symbol | NET40 | NET45 | .NET Core
----------------------------------- | ------------------ | ------------------ | ------------------
`FEATURE_APPDOMAIN` | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_ASSEMBLYBUILDER_SAVE` | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_BINDINGLIST` | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_DICTIONARYADAPTER_XML` | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_CUSTOMMODIFIERS` | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_EVENTLOG` | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_GAC` | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_GET_REFERENCED_ASSEMBLIES` | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_IDATAERRORINFO` | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_ISUPPORTINITIALIZE` | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_LEGACY_REFLECTION_API` | :white_check_mark: | :no_entry_sign: | :no_entry_sign:
`FEATURE_LISTSORT` | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_NETCORE_REFLECTION_API` | :no_entry_sign: | :no_entry_sign: | :white_check_mark:
`FEATURE_REMOTING` | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_SECURITY_PERMISSIONS` | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_SERIALIZATION` | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_SMTP` | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_SYSTEM_CONFIGURATION` | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_TARGETEXCEPTION` | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_TEST_COM` | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_TEST_DATASET` | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_TEST_PEVERIFY` | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`FEATURE_TEST_SERILOGINTEGRATION` | :no_entry_sign: | :white_check_mark: | :white_check_mark:
--- | | |
`DOTNET40` | :white_check_mark: | :white_check_mark: | :no_entry_sign:
`DOTNET45` | :no_entry_sign: | :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 All @@ -100,7 +99,7 @@ Symbol | NET35 | NET40 |
* `FEATURE_GET_REFERENCED_ASSEMBLIES` - enables code that takes advantage of System.Reflection.Assembly.GetReferencedAssemblies().
* `FEATURE_IDATAERRORINFO` - enables code that depends on System.ComponentModel.IDataErrorInfo.
* `FEATURE_ISUPPORTINITIALIZE` - enables support for features that make use of System.ComponentModel.ISupportInitialize.
* `FEATURE_LEGACY_REFLECTION_API` - provides a shim for .NET 3.5/4.0 that emulates the `TypeInfo` API available in .NET 4.5+ and .NET Core.
* `FEATURE_LEGACY_REFLECTION_API` - provides a shim for .NET 4.0 that emulates the `TypeInfo` API available in .NET 4.5+ and .NET Core.
* `FEATURE_LISTSORT` - enables support for features that make use of System.ComponentModel.ListSortDescription.
* `FEATURE_NETCORE_REFLECTION_API` - provides shims to implement missing functionality in .NET Core that has no alternatives.
* `FEATURE_REMOTING` - supports remoting on various types including inheriting from MarshalByRefObject.
Expand Down
5 changes: 2 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
image:
- Visual Studio 2017
- Visual Studio 2019
- Ubuntu


Expand All @@ -21,7 +21,6 @@ for:
# build and run tests
build_script:
- uname -a
- mono --version
- ./build.sh

# upload test results
Expand All @@ -37,7 +36,7 @@ for:
# -------------------
matrix:
only:
- image: Visual Studio 2017
- image: Visual Studio 2019

# update AppVeyor build version; this matters for deployments
init:
Expand Down
27 changes: 12 additions & 15 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,32 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ****************************************************************************
shopt -s expand_aliases

DOTNETPATH=$(which dotnet)
if [ ! -f "$DOTNETPATH" ]; then
echo "Please install Microsoft/netcore from: https://www.microsoft.com/net/core"
exit 1
fi
MONOPATH=$(which mono)

if [ ! -f "$MONOPATH" ]; then
echo "Please install Xamarin/mono from: http://www.mono-project.com/docs/getting-started/install/"
exit 1
DOCKERPATH=$(which docker)
if [ -f "$DOCKERPATH" ]; then
alias mono="$PWD/buildscripts/docker-run-mono.sh"
else
MONOPATH=$(which mono)
if [ ! -f "$MONOPATH" ]; then
echo "Please install either Docker, or Xamarin/Mono from http://www.mono-project.com/docs/getting-started/install/"
exit 1
fi
fi

# This lets `dotnet` know where to find Mono's reference assemblies when compiling for the `net461` platform:
export FrameworkPathOverride=$(dirname $MONOPATH)/../lib/mono/4.6.1-api/

dotnet restore ./src/Castle.Core/Castle.Core.csproj
dotnet restore ./src/Castle.Services.Logging.log4netIntegration/Castle.Services.Logging.log4netIntegration.csproj
dotnet restore ./src/Castle.Services.Logging.NLogIntegration/Castle.Services.Logging.NLogIntegration.csproj
dotnet restore ./src/Castle.Services.Logging.SerilogIntegration/Castle.Services.Logging.SerilogIntegration.csproj
dotnet restore ./src/Castle.Core.Tests/Castle.Core.Tests.csproj
dotnet restore ./src/Castle.Core.Tests.WeakNamed/Castle.Core.Tests.WeakNamed.csproj
mono --version

# Linux/Darwin
OSNAME=$(uname -s)
echo "OSNAME: $OSNAME"

dotnet build ./src/Castle.Core.Tests/Castle.Core.Tests.csproj /p:Configuration=Release || exit 1
dotnet build ./src/Castle.Core.Tests.WeakNamed/Castle.Core.Tests.WeakNamed.csproj /p:Configuration=Release || exit 1
dotnet build --configuration Release || exit 1

echo --------------------
echo Running NET461 Tests
Expand Down
17 changes: 2 additions & 15 deletions buildscripts/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,15 @@ if "%1" NEQ "" goto set_config

:set_config
SET Configuration=%1
GOTO restore_packages
GOTO build

:no_config
SET Configuration=Release
GOTO restore_packages

:restore_packages
dotnet restore ./tools/Explicit.NuGet.Versions/Explicit.NuGet.Versions.csproj
dotnet restore ./src/Castle.Core/Castle.Core.csproj
dotnet restore ./src/Castle.Core.Tests/Castle.Core.Tests.csproj
dotnet restore ./src/Castle.Core.Tests.WeakNamed/Castle.Core.Tests.WeakNamed.csproj
dotnet restore ./src/Castle.Services.Logging.log4netIntegration/Castle.Services.Logging.log4netIntegration.csproj
dotnet restore ./src/Castle.Services.Logging.NLogIntegration/Castle.Services.Logging.NLogIntegration.csproj
dotnet restore ./src/Castle.Services.Logging.SerilogIntegration/Castle.Services.Logging.SerilogIntegration.csproj
GOTO build

:build
rem Should be the line below but because of https://github.com/Microsoft/msbuild/issues/1333 we needed to use msbuild instead.
rem dotnet build Castle.Core.sln -c %Configuration%
dotnet build ./tools/Explicit.NuGet.Versions/Explicit.NuGet.Versions.sln
msbuild /p:Configuration=%Configuration% || exit /b 1
msbuild /p:Configuration=%Configuration% /t:Pack || exit /b 1
dotnet build --configuration %Configuration% || exit /b 1
.\tools\Explicit.NuGet.Versions\build\nev.exe ".\build" "castle."
GOTO test

Expand Down
12 changes: 4 additions & 8 deletions buildscripts/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
<Content Include="..\..\buildscripts\readme.txt" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>

<PropertyGroup>
<DiagnosticsConstants>DEBUG</DiagnosticsConstants>
<NetStandard13Constants>TRACE;FEATURE_NETCORE_REFLECTION_API;FEATURE_TEST_SERILOGINTEGRATION</NetStandard13Constants>
Expand All @@ -48,14 +52,6 @@
<DesktopClrConstants Condition="'$(OS)'=='Windows_NT'">$(CommonDesktopClrConstants);FEATURE_TEST_PEVERIFY</DesktopClrConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)|$(Configuration)'=='net35|Debug'">
<DefineConstants>$(DiagnosticsConstants);$(DesktopClrConstants);FEATURE_LEGACY_REFLECTION_API;DOTNET35</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)|$(Configuration)'=='net35|Release'">
<DefineConstants>$(DesktopClrConstants);FEATURE_LEGACY_REFLECTION_API;DOTNET35</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)|$(Configuration)'=='net40|Debug'">
<DefineConstants>$(DiagnosticsConstants);$(DesktopClrConstants);FEATURE_LEGACY_REFLECTION_API;DOTNET40</DefineConstants>
</PropertyGroup>
Expand Down
4 changes: 4 additions & 0 deletions buildscripts/docker-run-mono.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e
MONO_TAG=${MONO_TAG:-6.0.0.334}
docker run --rm -v "$PWD":'/project' -w='/project' mono:$MONO_TAG mono "$@"
3 changes: 1 addition & 2 deletions docs/dynamicproxy-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ 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 3.5 SP1+
* .NET Framework 4.0+
* .NET Core 1.0+ (Castle Core 4.0+)
* Silverlight 4.0+ (Silverlight support removed in Castle Core 4.0)
* `Castle.Core.dll` (assembly where DynamicProxy lives)

:information_source: **DynamicProxy assembly:** In previous versions (up to v2.2) DynamicProxy used to live in its own assembly `Castle.DynamicProxy.dll`. It was later moved to `Castle.Core.dll` and now no other assembly is required to use it.
Expand Down
4 changes: 0 additions & 4 deletions docs/dynamicproxy-optional-parameter-value-limitations.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ On Mono (up to and including at least version 5.16), DynamicProxy may not be abl

The .NET Framework (up to and including at least version 4.7.1) and .NET Core (up to and including at least version 2.1) are affected by several bugs or limitations regarding default parameter values. DynamicProxy may not be able to correctly reproduce default parameter values in the proxy type for...

* **Optional parameters of any nullable type `Nullable<T>`.** On the .NET Framework 3.5 only, reflection will likely report (via `ParameterInfo.[Raw]DefaultValue`) a default value of `Missing.Value` for such parameters.

There is no easy way to quickly guess what the correct default value might be. Consider upgrading to the .NET Framework 4 or later, or double-check the default value in the original method of the proxied type.

* **Optional parameters of some `struct` type `SomeStruct` having a default value of `default(SomeStruct)`.** If reflection reports (via `ParameterInfo.[Raw]DefaultValue`) a default value of `Missing.Value` for such parameters, you may safely assume that the *correct* default value is `default(SomeStruct)`.

Note that if reflection reports a default value of `null` in such cases, this is not an error, but normal `System.Reflection` behavior that is to be expected. In this case, you may also safely assume `default(SomeStruct)` to be the correct default value.
Expand Down
Loading