diff --git a/README.md b/README.md
index 5255804a5e..e571daedbc 100644
--- a/README.md
+++ b/README.md
@@ -42,12 +42,16 @@ Symbol | NET35 | NET40 |
----------------------------------- | ------------------ | ------------------ | ------------------ | ------------------
`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_EMIT_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_NETCORE_CONVERTER_API` | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :white_check_mark:
+`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:
@@ -68,17 +72,21 @@ Symbol | NET35 | NET40 |
* `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.
+* `FEATURE_BINDINGLIST` - enables support features that make use of System.ComponentModel.BindingList.
+* `FEATURE_DICTIONARYADAPTER_XML` - enable DictionaryAdapter Xml features.
* `FEATURE_EMIT_CUSTOMMODIFIERS` - enables emitting optional and required custom modifiers defined on parameters including return parameters. It seems like a defect in corefx not to expose these methods because they are still implemented.
* `FEATURE_EVENTLOG` - provides a diagnostics logger using the Windows Event Log.
* `FEATURE_GAC` - enables support for obtaining assemblies using an assembly long form name.
* `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_NETCORE_CONVERTER_API` - provides shims to implement missing Converter in .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.
* `FEATURE_SECURITY_PERMISSIONS` - enables the use of CAS and Security[Critical|SafeCritical|Transparent].
* `FEATURE_SERIALIZATION` - enables support for serialization of dynamic proxies and other types.
-* `FEATURE_SMTP` - providers the email sender abstraction and implementation.
+* `FEATURE_SMTP` - provides the email sender abstraction and implementation.
* `FEATURE_STRONGNAME` - supports a strong named `Castle.Core.dll` assembly.
* `FEATURE_SYSTEM_CONFIGURATION` - enables features that use System.Configuration and the ConfigurationManager.
* `FEATURE_TARGETEXCEPTION` - enabled catching a `TargetException`. `System.Reflection.TargetException` is implemented by .NET Core but not exposed by corefx.
diff --git a/Settings.proj b/Settings.proj
index 5189116eb8..2f41e8df68 100644
--- a/Settings.proj
+++ b/Settings.proj
@@ -57,10 +57,15 @@ limitations under the License.
$(AdditionalDefineConstants) FEATURE_APPDOMAIN
$(AdditionalDefineConstants) FEATURE_ASSEMBLYBUILDER_SAVE
+ $(AdditionalDefineConstants) FEATURE_BINDINGLIST
+ $(AdditionalDefineConstants) FEATURE_DICTIONARYADAPTER_XML
$(AdditionalDefineConstants) FEATURE_EMIT_CUSTOMMODIFIERS
$(AdditionalDefineConstants) FEATURE_EVENTLOG
$(AdditionalDefineConstants) FEATURE_GAC
$(AdditionalDefineConstants) FEATURE_GET_REFERENCED_ASSEMBLIES
+ $(AdditionalDefineConstants) FEATURE_IDATAERRORINFO
+ $(AdditionalDefineConstants) FEATURE_ISUPPORTINITIALIZE
+ $(AdditionalDefineConstants) FEATURE_LISTSORT
$(AdditionalDefineConstants) FEATURE_REMOTING
$(AdditionalDefineConstants) FEATURE_SECURITY_PERMISSIONS
$(AdditionalDefineConstants) FEATURE_SERIALIZATION
diff --git a/src/Castle.Core.Tests/BaseTestCaseTestCase.cs b/src/Castle.Core.Tests/BaseTestCaseTestCase.cs
index a7f377dd63..5675f99f8a 100644
--- a/src/Castle.Core.Tests/BaseTestCaseTestCase.cs
+++ b/src/Castle.Core.Tests/BaseTestCaseTestCase.cs
@@ -49,10 +49,8 @@ public void TearDown_DoesNotSaveAnything_IfNoProxyGenerated()
Assert.IsFalse(File.Exists(path));
}
+#if FEATURE_ASSEMBLYBUILDER_SAVE
[Test]
-#if SILVERLIGHT
- [Ignore("Cannot do in Silverlight")]
-#endif
#if __MonoCS__
[Ignore("Expected: True But was: False")]
#endif
@@ -69,6 +67,7 @@ public void TearDown_SavesAssembly_IfProxyGenerated()
base.TearDown();
Assert.IsTrue(File.Exists(path));
}
+#endif
private void FindVerificationErrors()
{
@@ -91,6 +90,7 @@ private void FindVerificationErrors()
base.TearDown();
}
+#if FEATURE_ASSEMBLYBUILDER_SAVE
[Test]
#if SILVERLIGHT
[Ignore("Cannot do in Silverlight")]
@@ -106,6 +106,7 @@ public void TearDown_FindsVerificationErrors()
StringAssert.Contains("PeVerify reported error(s)", ex.Message);
StringAssert.Contains("fall through end of the method without returning", ex.Message);
}
+#endif
[Test]
public void DisableVerification_DisablesVerificationForTestCase()
diff --git a/src/Castle.Core.Tests/BasicClassProxyTestCase.cs b/src/Castle.Core.Tests/BasicClassProxyTestCase.cs
index 3b05499eee..d3d873a4d6 100644
--- a/src/Castle.Core.Tests/BasicClassProxyTestCase.cs
+++ b/src/Castle.Core.Tests/BasicClassProxyTestCase.cs
@@ -89,7 +89,11 @@ public void ProxyForNonPublicClass()
var type = Type.GetType("System.AppDomainInitializerInfo, mscorlib");
var exception = Assert.Throws(() => generator.CreateClassProxy(type, new StandardInterceptor()));
Assert.AreEqual(
+#if FEATURE_STRONGNAME
"Can not create proxy for type System.AppDomainInitializerInfo because it is not accessible. Make it public, or internal and mark your assembly with [assembly: InternalsVisibleTo(\"DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7\")] attribute, because assembly mscorlib is strong-named.",
+#else
+ "Can not create proxy for type System.AppDomainInitializerInfo because it is not accessible. Make it public, or internal and mark your assembly with [assembly: InternalsVisibleTo(\"DynamicProxyGenAssembly2\")] attribute, because assembly mscorlib is strong-named.",
+#endif
exception.Message);
}
diff --git a/src/Castle.Core.Tests/BasicInterfaceProxyTestCase.cs b/src/Castle.Core.Tests/BasicInterfaceProxyTestCase.cs
index 8961d06358..7ab0b54014 100644
--- a/src/Castle.Core.Tests/BasicInterfaceProxyTestCase.cs
+++ b/src/Castle.Core.Tests/BasicInterfaceProxyTestCase.cs
@@ -252,6 +252,7 @@ public void Cannot_proxy_inaccessible_interface()
ex.Message);
}
+#if FEATURE_STRONGNAME
[Test]
public void Cannot_proxy_generic_interface_with_inaccessible_type_argument()
{
@@ -261,6 +262,7 @@ public void Cannot_proxy_generic_interface_with_inaccessible_type_argument()
"Can not create proxy for type System.Collections.Generic.IList`1[[Castle.DynamicProxy.Tests.BasicInterfaceProxyTestCase+PrivateInterface, Castle.Core.Tests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc]] because type Castle.DynamicProxy.Tests.BasicInterfaceProxyTestCase+PrivateInterface is not accessible. Make it public, or internal",
ex.Message);
}
+#endif
[Test]
public void Cannot_proxy_generic_interface_with_type_argument_that_has_inaccessible_type_argument()
diff --git a/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/CustomAssert.cs b/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/CustomAssert.cs
index 81940f8dca..0a96c46741 100644
--- a/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/CustomAssert.cs
+++ b/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/CustomAssert.cs
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#if !SILVERLIGHT // Until support for other platforms is verified
+#if FEATURE_DICTIONARYADAPTER_XML
namespace Castle.Components.DictionaryAdapter.Tests
{
using System;
diff --git a/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/DictionaryAdapterFactoryTestCase.cs b/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/DictionaryAdapterFactoryTestCase.cs
index 0d150b9733..1e21024a47 100644
--- a/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/DictionaryAdapterFactoryTestCase.cs
+++ b/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/DictionaryAdapterFactoryTestCase.cs
@@ -18,6 +18,7 @@ namespace Castle.Components.DictionaryAdapter.Tests
using System.Collections;
using System.Collections.Generic;
using System.Linq;
+ using System.Reflection;
using CastleTests.Components.DictionaryAdapter.Tests;
@@ -429,7 +430,7 @@ public void ReadAdapter_WithDefaultConversions_WorksFine()
dictionary["Double"] = string.Format("{0}", 3.14D);
dictionary["Decimal"] = string.Format("{0}", 100M);
dictionary["String"] = "Hello World";
- dictionary["DateTime"] = now.ToShortDateString();
+ dictionary["DateTime"] = now.ToString("d");
dictionary["Guid"] = guid.ToString();
var conversions = factory.GetAdapter(dictionary);
@@ -468,7 +469,7 @@ public void UpdateAdapter_WithDefaultConversions_WorksFine()
#if SILVERLIGHT // SL impl limitation
Assert.AreEqual(today.ToString(), dictionary["DateTime"]);
#else
- Assert.AreEqual(today.ToShortDateString(), dictionary["DateTime"]);
+ Assert.AreEqual(today.ToString("d"), dictionary["DateTime"]);
#endif
Assert.AreEqual(guid.ToString(), dictionary["Guid"]);
Assert.AreEqual("2124751012,22", dictionary["Phone"]);
@@ -484,7 +485,7 @@ public void ReadAdapter_WithDefaultNullableConversions_WorksFine()
dictionary["NullFloat"] = string.Format("{0}", 98.6);
dictionary["NullDouble"] = string.Format("{0}", 3.14D);
dictionary["NullDecimal"] = string.Format("{0}", 100M);
- dictionary["NullDateTime"] = now.Value.ToShortDateString();
+ dictionary["NullDateTime"] = now.Value.ToString("d");
dictionary["NullGuid"] = guid.ToString();
var conversions = factory.GetAdapter(dictionary);
@@ -517,7 +518,7 @@ public void UpdateAdapter_WithDefaultNullableConversions_WorksFine()
#if SILVERLIGHT // SL impl limitation
Assert.AreEqual(today.Value.ToString(), dictionary["NullDateTime"]);
#else
- Assert.AreEqual(today.Value.ToShortDateString(), dictionary["NullDateTime"]);
+ Assert.AreEqual(today.Value.ToString("d"), dictionary["NullDateTime"]);
#endif
Assert.AreEqual(guid.ToString(), dictionary["NullGuid"]);
}
@@ -767,7 +768,7 @@ public void WillNotPropagatePropertyChangedEventWhenNestedPropertyChanged()
container.Item.Name = "Craig";
}
-#if !SILVERLIGHT //no BindingList in Silverlight
+#if FEATURE_BINDINGLIST
[Test]
public void WillPropagatePropertyChangedEventWhenBindingListPropertyChanged()
@@ -1123,6 +1124,7 @@ public void CanInitializeTheDictionaryAdapterWithAttributes()
Assert.IsTrue(((IDictionaryAdapter)name).Validators.OfType().Any());
}
+#if FEATURE_IDATAERRORINFO
[Test]
public void CanValidateAndObtainDataErrorInformation()
{
@@ -1188,6 +1190,7 @@ public void WillNotifyPropertyChangesOnValidateGroup()
name.LastName = "Monster";
Assert.IsTrue(notifyCalled);
}
+#endif
[Test]
public void CanCreateDictionaryAdapterFromExistingAdapter()
@@ -1257,7 +1260,7 @@ public void CanGetInterfacePropertyOnDemand()
Assert.IsNotNull(container.Phone);
}
-#if !SILVERLIGHT //no BindingList in Silverlight
+#if FEATURE_BINDINGLIST
[Test]
public void CanAddBindingListItemsOnDemand()
@@ -1321,7 +1324,7 @@ public void CanGetNewGuidPropertyOnDemand()
public void CanDetermineTheAdaptedInterface()
{
var person = factory.GetAdapter(dictionary);
- var type = person.GetType().GetCustomAttributes(
+ var type = person.GetType().GetTypeInfo().GetCustomAttributes(
typeof(DictionaryAdapterAttribute), false).Cast()
.FirstOrDefault();
Assert.IsNotNull(type);
diff --git a/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/IAddress.cs b/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/IAddress.cs
index 97b153a1b3..64490f64ec 100644
--- a/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/IAddress.cs
+++ b/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/IAddress.cs
@@ -17,7 +17,10 @@ namespace Castle.Components.DictionaryAdapter.Tests
using System.ComponentModel;
//[PropagateNotifications(false)]
- public interface IAddress : IEditableObject, INotifyPropertyChanged, IDataErrorInfo
+ public interface IAddress : IEditableObject, INotifyPropertyChanged
+#if FEATURE_IDATAERRORINFO
+ , IDataErrorInfo
+#endif
{
string Line1 { get; set; }
string Line2 { get; set; }
diff --git a/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/IItemContainer.cs b/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/IItemContainer.cs
index b216012625..b268a99a24 100644
--- a/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/IItemContainer.cs
+++ b/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/IItemContainer.cs
@@ -43,7 +43,7 @@ public interface IItemContainer : IDictionaryAdapter, IDictionaryCreate,
IList GenericItems { get; set; }
-#if !SILVERLIGHT
+#if FEATURE_BINDINGLIST
BindingList Bindingtems { get; set; }
#endif
diff --git a/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/IPerson.cs b/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/IPerson.cs
index efede7f277..d92c8fa00e 100644
--- a/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/IPerson.cs
+++ b/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/IPerson.cs
@@ -19,7 +19,10 @@ namespace Castle.Components.DictionaryAdapter.Tests
using System.ComponentModel;
[MultiLevelEdit]
- public interface IPerson : IDictionaryAdapter, IEditableObject, IDictionaryNotify, IDataErrorInfo
+ public interface IPerson : IDictionaryAdapter, IEditableObject, IDictionaryNotify
+#if FEATURE_IDATAERRORINFO
+ , IDataErrorInfo
+#endif
{
[RemoveIf(null)]
string Name { get; set; }
diff --git a/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/IPhone.cs b/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/IPhone.cs
index b6a370ae52..81d054709a 100644
--- a/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/IPhone.cs
+++ b/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/IPhone.cs
@@ -16,7 +16,10 @@ namespace Castle.Components.DictionaryAdapter.Tests
{
using System.ComponentModel;
- public interface IPhone : IEditableObject, INotifyPropertyChanged, IDataErrorInfo
+ public interface IPhone : IEditableObject, INotifyPropertyChanged
+#if FEATURE_IDATAERRORINFO
+ , IDataErrorInfo
+#endif
{
[Fetch]string Number { get; set; }
string Extension { get; set; }
diff --git a/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/InfrastructureStub.cs b/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/InfrastructureStub.cs
index ef827f1ad8..badc0bdc4c 100644
--- a/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/InfrastructureStub.cs
+++ b/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/InfrastructureStub.cs
@@ -18,8 +18,9 @@ namespace Castle.Components.DictionaryAdapter.Tests
using System.ComponentModel;
public abstract class InfrastructureStub : INotifyPropertyChanged, IEditableObject
-
-, IDataErrorInfo
+#if FEATURE_IDATAERRORINFO
+ , IDataErrorInfo
+#endif
{
public event PropertyChangedEventHandler PropertyChanged;
diff --git a/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/MemberwiseEqualityHashCodeStrategyTestCase.cs b/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/MemberwiseEqualityHashCodeStrategyTestCase.cs
index febe9a68bd..bb1ad9fd06 100644
--- a/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/MemberwiseEqualityHashCodeStrategyTestCase.cs
+++ b/src/Castle.Core.Tests/Components.DictionaryAdapter.Tests/MemberwiseEqualityHashCodeStrategyTestCase.cs
@@ -14,7 +14,7 @@
namespace Castle.Components.DictionaryAdapter.Tests
{
-#if !SILVERLIGHT
+#if FEATURE_DICTIONARYADAPTER_XML
using System;
using System.Collections;
using System.Collections.Generic;
diff --git a/src/Castle.Core.Tests/Core.Tests/Resources/AssemblyResourceFactoryTestCase.cs b/src/Castle.Core.Tests/Core.Tests/Resources/AssemblyResourceFactoryTestCase.cs
index 37136e1742..0e4a8a3c83 100644
--- a/src/Castle.Core.Tests/Core.Tests/Resources/AssemblyResourceFactoryTestCase.cs
+++ b/src/Castle.Core.Tests/Core.Tests/Resources/AssemblyResourceFactoryTestCase.cs
@@ -55,7 +55,8 @@ public void CanHandleBundleResource()
{
IResource resource =
new AssemblyBundleResource(
- new CustomUri("assembly://" + AssemblyName + "/CastleTests.Core.Tests.Resources.MoreRes.TestRes/content1"));
+ new CustomUri("assembly://" + AssemblyName + "/CastleTests.Core.Tests.Resources.MoreRes.TestRes/content1")
+ );
Assert.IsNotNull(resource);
var line = resource.GetStreamReader().ReadLine();
@@ -66,7 +67,6 @@ public void CanHandleBundleResource()
public void CreateWithAbsolutePath()
{
var resource = resFactory.Create(new CustomUri("assembly://" + AssemblyName + "/CastleTests.Core.Tests.Resources.file1.txt"));
-
Assert.IsNotNull(resource);
var line = resource.GetStreamReader().ReadLine();
Assert.AreEqual("Something", line);
diff --git a/src/Castle.Core.Tests/DynamicProxy.Tests/ClassProxyConstructorsTestCase.cs b/src/Castle.Core.Tests/DynamicProxy.Tests/ClassProxyConstructorsTestCase.cs
index d73f7b6630..ccef6b9861 100644
--- a/src/Castle.Core.Tests/DynamicProxy.Tests/ClassProxyConstructorsTestCase.cs
+++ b/src/Castle.Core.Tests/DynamicProxy.Tests/ClassProxyConstructorsTestCase.cs
@@ -129,6 +129,7 @@ public void Cannot_proxy_inaccessible_class()
ex.Message);
}
+#if FEATURE_STRONGNAME
[Test]
public void Cannot_proxy_generic_class_with_inaccessible_type_argument()
{
@@ -138,6 +139,7 @@ public void Cannot_proxy_generic_class_with_inaccessible_type_argument()
"Can not create proxy for type System.Collections.Generic.List`1[[Castle.DynamicProxy.Tests.ClassProxyConstructorsTestCase+PrivateClass, Castle.Core.Tests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc]] because type Castle.DynamicProxy.Tests.ClassProxyConstructorsTestCase+PrivateClass is not accessible. Make it public, or internal",
ex.Message);
}
+#endif
[Test]
public void Cannot_proxy_generic_class_with_type_argument_that_has_inaccessible_type_argument()
diff --git a/src/Castle.Core.Tests/DynamicProxy.Tests/ClassProxyWithTargetTestCase.cs b/src/Castle.Core.Tests/DynamicProxy.Tests/ClassProxyWithTargetTestCase.cs
index 674d504192..ead28674b9 100644
--- a/src/Castle.Core.Tests/DynamicProxy.Tests/ClassProxyWithTargetTestCase.cs
+++ b/src/Castle.Core.Tests/DynamicProxy.Tests/ClassProxyWithTargetTestCase.cs
@@ -111,6 +111,7 @@ public void Cannot_proxy_inaccessible_class()
ex.Message);
}
+#if FEATURE_STRONGNAME
[Test]
public void Cannot_proxy_generic_class_with_inaccessible_type_argument()
{
@@ -120,6 +121,7 @@ public void Cannot_proxy_generic_class_with_inaccessible_type_argument()
"Can not create proxy for type System.Collections.Generic.List`1[[Castle.DynamicProxy.Tests.ClassProxyWithTargetTestCase+PrivateClass, Castle.Core.Tests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc]] because type Castle.DynamicProxy.Tests.ClassProxyWithTargetTestCase+PrivateClass is not accessible. Make it public, or internal",
ex.Message);
}
+#endif
[Test]
public void Cannot_proxy_generic_class_with_type_argument_that_has_inaccessible_type_argument()
diff --git a/src/Castle.Core.Tests/GenClasses/GenClassWithGenMethods.cs b/src/Castle.Core.Tests/GenClasses/GenClassWithGenMethods.cs
index e8eb86a228..c1778fc1b0 100644
--- a/src/Castle.Core.Tests/GenClasses/GenClassWithGenMethods.cs
+++ b/src/Castle.Core.Tests/GenClasses/GenClassWithGenMethods.cs
@@ -40,11 +40,13 @@ public virtual T DoSomething(Z z)
return new T();
}
- public virtual void DoSomethingElse(Converter converter, int value)
+ public virtual void DoSomethingElse(TestConverter converter, int value)
{
invoked = true;
savedParam = converter(value);
}
}
+
+ public delegate TOutput TestConverter(TInput input);
}
\ No newline at end of file
diff --git a/src/Castle.Core.Tests/InterceptorSelectorTestCase.cs b/src/Castle.Core.Tests/InterceptorSelectorTestCase.cs
index 2f1dca1695..fce17bf187 100644
--- a/src/Castle.Core.Tests/InterceptorSelectorTestCase.cs
+++ b/src/Castle.Core.Tests/InterceptorSelectorTestCase.cs
@@ -299,6 +299,7 @@ public void Cannot_proxy_inaccessible_interface()
ex.Message);
}
+#if FEATURE_STRONGNAME
[Test]
public void Cannot_proxy_generic_interface_with_inaccessible_type_argument()
{
@@ -308,6 +309,7 @@ public void Cannot_proxy_generic_interface_with_inaccessible_type_argument()
"Can not create proxy for type System.Collections.Generic.IList`1[[Castle.DynamicProxy.Tests.InterceptorSelectorTestCase+PrivateInterface, Castle.Core.Tests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc]] because type Castle.DynamicProxy.Tests.InterceptorSelectorTestCase+PrivateInterface is not accessible. Make it public, or internal",
ex.Message);
}
+#endif
[Test]
public void Cannot_proxy_generic_interface_with_type_argument_that_has_inaccessible_type_argument()
diff --git a/src/Castle.Core.Tests/InterfaceProxyWithTargetInterfaceTestCase.cs b/src/Castle.Core.Tests/InterfaceProxyWithTargetInterfaceTestCase.cs
index 53b80937cd..165412906d 100644
--- a/src/Castle.Core.Tests/InterfaceProxyWithTargetInterfaceTestCase.cs
+++ b/src/Castle.Core.Tests/InterfaceProxyWithTargetInterfaceTestCase.cs
@@ -190,6 +190,7 @@ public void Cannot_proxy_inaccessible_interface()
ex.Message);
}
+#if FEATURE_STRONGNAME
[Test]
public void Cannot_proxy_generic_interface_with_inaccessible_type_argument()
{
@@ -199,6 +200,7 @@ public void Cannot_proxy_generic_interface_with_inaccessible_type_argument()
"Can not create proxy for type System.Collections.Generic.IList`1[[Castle.DynamicProxy.Tests.InterfaceProxyWithTargetInterfaceTestCase+PrivateInterface, Castle.Core.Tests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc]] because type Castle.DynamicProxy.Tests.InterfaceProxyWithTargetInterfaceTestCase+PrivateInterface is not accessible. Make it public, or internal",
ex.Message);
}
+#endif
[Test]
public void Cannot_proxy_generic_interface_with_type_argument_that_has_inaccessible_type_argument()
diff --git a/src/Castle.Core.Tests/ModuleScopeTestCase.cs b/src/Castle.Core.Tests/ModuleScopeTestCase.cs
index ce84eef96b..85c4fa990b 100644
--- a/src/Castle.Core.Tests/ModuleScopeTestCase.cs
+++ b/src/Castle.Core.Tests/ModuleScopeTestCase.cs
@@ -65,6 +65,7 @@ public void ModuleScopeCanHandleSignedAndUnsignedInParallel()
#if !SILVERLIGHT
+#if FEATURE_STRONGNAME
[Test]
#if __MonoCS__
[Ignore("Expected: CastleDynProxy2.dll But was: /home/teamcity/buildagent/work/...")]
@@ -110,7 +111,6 @@ public void ExplicitModulePaths()
Assert.AreEqual(@"d:\Bar", scope.WeakNamedModuleDirectory);
}
-#if FEATURE_STRONGNAME
private static void CheckSignedSavedAssembly(string path)
{
Assert.IsTrue(File.Exists(path));
diff --git a/src/Castle.Core.Tests/TestDictionaryValidator.cs b/src/Castle.Core.Tests/TestDictionaryValidator.cs
index c5902e2669..6911bfa38e 100644
--- a/src/Castle.Core.Tests/TestDictionaryValidator.cs
+++ b/src/Castle.Core.Tests/TestDictionaryValidator.cs
@@ -47,11 +47,11 @@ public bool IsValid(IDictionaryAdapter dictionaryAdapter)
public string Validate(IDictionaryAdapter dictionaryAdapter)
{
List errors = new List();
- var globalRules = AttributesUtil.GetTypeAttributes(dictionaryAdapter.Meta.Type);
+ var globalRules = AttributesUtil.GetTypeAttributes(dictionaryAdapter.Meta.Type);
foreach (var property in dictionaryAdapter.This.Properties.Values)
{
- var propertyRules = AttributesUtil.GetAttributes(property.Property);
+ var propertyRules = AttributesUtil.GetAttributes(property.Property);
var propertyValue = dictionaryAdapter.GetProperty(property.PropertyName, true);
ApplyValidationRules(dictionaryAdapter, propertyRules, property, propertyValue, errors);
ApplyValidationRules(dictionaryAdapter, globalRules, property, propertyValue, errors);
@@ -63,9 +63,9 @@ public string Validate(IDictionaryAdapter dictionaryAdapter)
public string Validate(IDictionaryAdapter dictionaryAdapter, PropertyDescriptor property)
{
List errors = new List();
- var globalRules = AttributesUtil.GetTypeAttributes(dictionaryAdapter.Meta.Type);
+ var globalRules = AttributesUtil.GetTypeAttributes(dictionaryAdapter.Meta.Type);
- var propertyRules = AttributesUtil.GetAttributes(property.Property);
+ var propertyRules = AttributesUtil.GetAttributes(property.Property);
var propertyValue = dictionaryAdapter.GetProperty(property.PropertyName, true);
ApplyValidationRules(dictionaryAdapter, propertyRules, property, propertyValue, errors);
ApplyValidationRules(dictionaryAdapter, globalRules, property, propertyValue, errors);
diff --git a/src/Castle.Core.Tests/TraceLoggerTests.cs b/src/Castle.Core.Tests/TraceLoggerTests.cs
index e7e96be6c0..dbb4914099 100644
--- a/src/Castle.Core.Tests/TraceLoggerTests.cs
+++ b/src/Castle.Core.Tests/TraceLoggerTests.cs
@@ -51,6 +51,7 @@ public void Cleanup()
Listener.ClearMessages();
}
+#if FEATURE_SYSTEM_CONFIGURATION
[Test]
[Platform(Exclude = "mono", Reason = "Mono has a bug that causes the listeners to not fully work.")]
public void WritingToLoggerByType()
@@ -118,6 +119,7 @@ public void FallUpToDefaultSource()
Listener.AssertContains("defaultrule", "System.Xml.XmlDocument");
Listener.AssertContains("defaultrule", "Logging to non-configured namespace namespace");
}
+#endif
#region in-memory listener class
diff --git a/src/Castle.Core.Tests/project.json b/src/Castle.Core.Tests/project.json
index 45652576dd..6c8b989eff 100644
--- a/src/Castle.Core.Tests/project.json
+++ b/src/Castle.Core.Tests/project.json
@@ -7,6 +7,9 @@
"licenseUrl": "",
"dependencies": {
"Castle.Core": "3.3.4-*",
+ "Microsoft.CSharp": "4.0.0",
+ "System.Console": "4.0.0-beta-23123",
+ "System.Diagnostics.TraceSource": "4.0.0-beta-23123",
"System.Runtime": "4.0.20",
"xunit": "2.1.0",
"xunit.runner.dnx": "2.1.0-beta6-build191"
@@ -21,15 +24,14 @@
"warningsAsErrors": true,
"define": [ "FEATURE_XUNITNET" ]
},
- "resource": [
- "Core.Tests/Resources/MoreRes/TestRes.resx"
- ],
+ "namedResource": {
+ "CastleTests.Core.Tests.Resources.MoreRes.TestRes": "Core.Tests/Resources/MoreRes/TestRes.resx",
+ "CastleTests.Core.Tests.Resources.file1.txt": "Core.Tests/Resources/file1.txt"
+ },
"exclude": [
- "Components.DictionaryAdapter.Tests/**/*",
+ "Components.DictionaryAdapter.Tests/Xml/**/*",
"log4netIntegration/**/*",
"NLogIntegration/**/*",
- "SerilogIntegration/**/*",
- "TestDictionaryValidator.cs",
- "IdEqualityHashCodeStrategy.cs"
+ "SerilogIntegration/**/*"
]
}
\ No newline at end of file
diff --git a/src/Castle.Core/Compatibility/NetCoreConverterExtensions.cs b/src/Castle.Core/Compatibility/NetCoreConverterExtensions.cs
deleted file mode 100644
index ef7a648e1c..0000000000
--- a/src/Castle.Core/Compatibility/NetCoreConverterExtensions.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2004-2015 Castle Project - http://www.castleproject.org/
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#if FEATURE_NETCORE_CONVERTER_API
-
-namespace System
-{
- public delegate TOutput Converter(TInput input);
-}
-
-#endif
\ No newline at end of file
diff --git a/src/Castle.Core/Components.DictionaryAdapter/Attributes/OnDemandAttribute.cs b/src/Castle.Core/Components.DictionaryAdapter/Attributes/OnDemandAttribute.cs
index 412c813ce8..0da13ab4bf 100644
--- a/src/Castle.Core/Components.DictionaryAdapter/Attributes/OnDemandAttribute.cs
+++ b/src/Castle.Core/Components.DictionaryAdapter/Attributes/OnDemandAttribute.cs
@@ -118,11 +118,13 @@ public object GetPropertyValue(IDictionaryAdapter dictionaryAdapter, string key,
{
using (dictionaryAdapter.SuppressNotificationsBlock())
{
+#if FEATURE_ISUPPORTINITIALIZE
if (storedValue is ISupportInitialize)
{
((ISupportInitialize)storedValue).BeginInit();
((ISupportInitialize)storedValue).EndInit();
}
+#endif
if (initializer != null)
{
initializer.Initialize(dictionaryAdapter, storedValue);
@@ -160,7 +162,7 @@ private static Type GetInferredType(IDictionaryAdapter dictionaryAdapter, Proper
var genericDef = type.GetGenericTypeDefinition();
var genericArg = type.GetGenericArguments()[0];
bool isBindingList =
-#if SILVERLIGHT
+#if !FEATURE_BINDINGLIST
false;
#else
genericDef == typeof(System.ComponentModel.BindingList<>);
@@ -170,14 +172,14 @@ private static Type GetInferredType(IDictionaryAdapter dictionaryAdapter, Proper
{
if (dictionaryAdapter.CanEdit)
{
-#if SILVERLIGHT
+#if !FEATURE_BINDINGLIST
collectionType = typeof(EditableList<>);
#else
collectionType = isBindingList ? typeof(EditableBindingList<>) : typeof(EditableList<>);
#endif
}
-#if !SILVERLIGHT
+#if FEATURE_BINDINGLIST
if (isBindingList && genericArg.GetTypeInfo().IsInterface)
{
Func