diff --git a/src/Castle.Core.Tests/BaseTestCaseTestCase.cs b/src/Castle.Core.Tests/BaseTestCaseTestCase.cs
index 780ef28..8490533 100644
--- a/src/Castle.Core.Tests/BaseTestCaseTestCase.cs
+++ b/src/Castle.Core.Tests/BaseTestCaseTestCase.cs
@@ -1,112 +1,112 @@
-// Copyright 2004-2010 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.
-
-namespace Castle.DynamicProxy.Tests
-{
-	using System;
-	using System.IO;
-	using System.Reflection;
-	using System.Reflection.Emit;
-
-	using NUnit.Framework;
-
-	[TestFixture]
-	public class BaseTestCaseTestCase : BasePEVerifyTestCase
-	{
-		public override void TearDown()
-		{
-			ResetGeneratorAndBuilder(); // we call TearDown ourselves in these test cases
-			base.TearDown();
-		}
-		[Test]
-#if SILVERLIGHT
-		[Ignore("This passes in NUnit, but when run in a Browser test harness like UnitDriven this failed because of access to the disk???")]
-#endif
-		public void TearDown_DoesNotSaveAnything_IfNoProxyGenerated()
-		{
-			string path = ModuleScope.DEFAULT_FILE_NAME;
-			if (File.Exists(path))
-				File.Delete(path);
-
-			base.TearDown();
-
-			Assert.IsFalse(File.Exists(path));
-		}
-
-		[Test]
-#if SILVERLIGHT
-		[Ignore("Cannot do in Silverlight")]
-#endif
-#if __MonoCS__
-		[Ignore("Expected: True  But was: False")]
-#endif
-		public void TearDown_SavesAssembly_IfProxyGenerated()
-		{
-			string path = ModuleScope.DEFAULT_FILE_NAME;
-			if (File.Exists(path))
-				File.Delete(path);
-
-			generator.CreateClassProxy(typeof (object), new StandardInterceptor());
-
-			base.TearDown();
-			Assert.IsTrue(File.Exists(path));
-		}
-
-		[Test]
-#if SILVERLIGHT
-		[Ignore("Cannot do in Silverlight")]
-#endif
-#if __MonoCS__
-		[Ignore("NUnit.Framework.AssertionException was expected")]
-#endif
-		[ExpectedException(typeof (AssertionException))]
-		public void TearDown_FindsVerificationErrors()
-		{
-			ModuleBuilder moduleBuilder = generator.ProxyBuilder.ModuleScope.ObtainDynamicModule(true);
-			TypeBuilder invalidType = moduleBuilder.DefineType("InvalidType");
-			MethodBuilder invalidMethod = invalidType.DefineMethod("InvalidMethod", MethodAttributes.Public);
-			invalidMethod.GetILGenerator().Emit(OpCodes.Ldnull); // missing RET statement
-
-			invalidType.CreateType();
-
-			if (!IsVerificationDisabled)
-				Console.WriteLine("This next test case is expected to yield a verification error.");
-
-			base.TearDown();
-		}
-
-		[Test]
-		public void DisableVerification_DisablesVerificationForTestCase()
-		{
-			DisableVerification();
-			TearDown_FindsVerificationErrors();
-		}
-
-		[Test]
-		public void DisableVerification_ResetInNextTestCase1()
-		{
-			Assert.IsFalse(IsVerificationDisabled);
-			DisableVerification();
-			Assert.IsTrue(IsVerificationDisabled);
-		}
-
-		[Test]
-		public void DisableVerification_ResetInNextTestCase2()
-		{
-			Assert.IsFalse(IsVerificationDisabled);
-			DisableVerification();
-			Assert.IsTrue(IsVerificationDisabled);
-		}
-	}
-}
+// Copyright 2004-2010 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.
+
+namespace Castle.DynamicProxy.Tests
+{
+	using System;
+	using System.IO;
+	using System.Reflection;
+	using System.Reflection.Emit;
+
+	using NUnit.Framework;
+
+	[TestFixture]
+	public class BaseTestCaseTestCase : BasePEVerifyTestCase
+	{
+		public override void TearDown()
+		{
+			ResetGeneratorAndBuilder(); // we call TearDown ourselves in these test cases
+			base.TearDown();
+		}
+		[Test]
+#if SILVERLIGHT
+		[Ignore("This passes in NUnit, but when run in a Browser test harness like UnitDriven this failed because of access to the disk???")]
+#endif
+		public void TearDown_DoesNotSaveAnything_IfNoProxyGenerated()
+		{
+			string path = ModuleScope.DEFAULT_FILE_NAME;
+			if (File.Exists(path))
+				File.Delete(path);
+
+			base.TearDown();
+
+			Assert.IsFalse(File.Exists(path));
+		}
+
+		[Test]
+#if SILVERLIGHT
+		[Ignore("Cannot do in Silverlight")]
+#endif
+#if __MonoCS__
+		[Ignore("Expected: True  But was: False")]
+#endif
+		public void TearDown_SavesAssembly_IfProxyGenerated()
+		{
+			string path = ModuleScope.DEFAULT_FILE_NAME;
+			if (File.Exists(path))
+				File.Delete(path);
+
+			generator.CreateClassProxy(typeof (object), new StandardInterceptor());
+
+			base.TearDown();
+			Assert.IsTrue(File.Exists(path));
+		}
+
+		[Test]
+#if SILVERLIGHT
+		[Ignore("Cannot do in Silverlight")]
+#endif
+#if __MonoCS__
+		[Ignore("NUnit.Framework.AssertionException was expected")]
+#endif
+		[ExpectedException(typeof (AssertionException))]
+		public void TearDown_FindsVerificationErrors()
+		{
+			ModuleBuilder moduleBuilder = generator.ProxyBuilder.ModuleScope.ObtainDynamicModule(true);
+			TypeBuilder invalidType = moduleBuilder.DefineType("InvalidType");
+			MethodBuilder invalidMethod = invalidType.DefineMethod("InvalidMethod", MethodAttributes.Public);
+			invalidMethod.GetILGenerator().Emit(OpCodes.Ldnull); // missing RET statement
+
+			invalidType.CreateType();
+
+			if (!IsVerificationDisabled)
+				Console.WriteLine("This next test case is expected to yield a verification error.");
+
+			base.TearDown();
+		}
+
+		[Test]
+		public void DisableVerification_DisablesVerificationForTestCase()
+		{
+			DisableVerification();
+			TearDown_FindsVerificationErrors();
+		}
+
+		[Test]
+		public void DisableVerification_ResetInNextTestCase1()
+		{
+			Assert.IsFalse(IsVerificationDisabled);
+			DisableVerification();
+			Assert.IsTrue(IsVerificationDisabled);
+		}
+
+		[Test]
+		public void DisableVerification_ResetInNextTestCase2()
+		{
+			Assert.IsFalse(IsVerificationDisabled);
+			DisableVerification();
+			Assert.IsTrue(IsVerificationDisabled);
+		}
+	}
+}
diff --git a/src/Castle.Core.Tests/BugsReported/ConstraintViolationInDebuggerTestCase.cs b/src/Castle.Core.Tests/BugsReported/ConstraintViolationInDebuggerTestCase.cs
index 54db5bd..52cfa1a 100644
--- a/src/Castle.Core.Tests/BugsReported/ConstraintViolationInDebuggerTestCase.cs
+++ b/src/Castle.Core.Tests/BugsReported/ConstraintViolationInDebuggerTestCase.cs
@@ -1,92 +1,89 @@
-// Copyright 2004-2010 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.
-
-namespace Castle.DynamicProxy.Tests.BugsReported
-{
-	using System;
-
-	using NUnit.Framework;
-
-	[TestFixture]
-	public class ConstraintViolationInDebuggerTestCase : BasePEVerifyTestCase
-	{
-		// This test case yields a TypeLoadException in the debugger, but works perfectly without a debugger attached.
-		// It also produces verifiable code.
-		// In Visual Studio 2010 this test passes just fine with the debugger attached.
-		[Test]
-#if __MonoCS__
-		[Ignore("System.Type[] doesn't implement interface Castle.DynamicProxy.IInvocation")]
-#endif
-		public void TestCase()
-		{
-			generator.ProxyBuilder.CreateInterfaceProxyTypeWithTarget(
-				typeof (IPresentationHost), Type.EmptyTypes, typeof (PresentationHost), ProxyGenerationOptions.Default);
-
-			IServiceAgent agent =
-				(IServiceAgent)
-				generator.CreateInterfaceProxyWithTarget<IServiceAgent>(new ServiceAgent(), new StandardInterceptor());
-			agent.GetProxy<string>();
-		}
-
-		public class PresentationHost : IPresentationHost
-		{
-			#region IPresentationHost Members
-
-			public void Register<T>() where T : IPresentation
-			{
-			}
-
-			public void Register<T>(Type service) where T : IPresentation
-			{
-			}
-
-			#endregion
-		}
-
-		public class ServiceAgent : IServiceAgent
-		{
-			#region IServiceAgent Members
-
-			public T GetProxy<T>() where T : class
-			{
-				return null;
-			}
-
-			public T GetProxy<T>(object callbackInstance) where T : class
-			{
-				return null;
-			}
-
-			#endregion
-		}
-
-
-		public interface IPresentationHost
-		{
-			void Register<T>() where T : IPresentation;
-			void Register<T>(Type service) where T : IPresentation;
-		}
-
-		public interface IServiceAgent
-		{
-			T GetProxy<T>() where T : class;
-			T GetProxy<T>(object callbackInstance) where T : class;
-		}
-
-
-		public interface IPresentation
-		{
-		}
-	}
+// Copyright 2004-2010 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.
+
+namespace Castle.DynamicProxy.Tests.BugsReported
+{
+	using System;
+
+	using NUnit.Framework;
+
+	[TestFixture]
+	public class ConstraintViolationInDebuggerTestCase : BasePEVerifyTestCase
+	{
+		// This test case yields a TypeLoadException in the debugger, but works perfectly without a debugger attached.
+		// It also produces verifiable code.
+		// In Visual Studio 2010 this test passes just fine with the debugger attached.
+		[Test]
+		public void TestCase()
+		{
+			generator.ProxyBuilder.CreateInterfaceProxyTypeWithTarget(
+				typeof (IPresentationHost), Type.EmptyTypes, typeof (PresentationHost), ProxyGenerationOptions.Default);
+
+			IServiceAgent agent =
+				(IServiceAgent)
+				generator.CreateInterfaceProxyWithTarget<IServiceAgent>(new ServiceAgent(), new StandardInterceptor());
+			agent.GetProxy<string>();
+		}
+
+		public class PresentationHost : IPresentationHost
+		{
+			#region IPresentationHost Members
+
+			public void Register<T>() where T : IPresentation
+			{
+			}
+
+			public void Register<T>(Type service) where T : IPresentation
+			{
+			}
+
+			#endregion
+		}
+
+		public class ServiceAgent : IServiceAgent
+		{
+			#region IServiceAgent Members
+
+			public T GetProxy<T>() where T : class
+			{
+				return null;
+			}
+
+			public T GetProxy<T>(object callbackInstance) where T : class
+			{
+				return null;
+			}
+
+			#endregion
+		}
+
+
+		public interface IPresentationHost
+		{
+			void Register<T>() where T : IPresentation;
+			void Register<T>(Type service) where T : IPresentation;
+		}
+
+		public interface IServiceAgent
+		{
+			T GetProxy<T>() where T : class;
+			T GetProxy<T>(object callbackInstance) where T : class;
+		}
+
+
+		public interface IPresentation
+		{
+		}
+	}
 }
\ No newline at end of file
diff --git a/src/Castle.Core.Tests/DynamicProxy.Tests/ClassProxyWithDefaultValuesTestCase.cs b/src/Castle.Core.Tests/DynamicProxy.Tests/ClassProxyWithDefaultValuesTestCase.cs
index 16fd345..fe505b7 100644
--- a/src/Castle.Core.Tests/DynamicProxy.Tests/ClassProxyWithDefaultValuesTestCase.cs
+++ b/src/Castle.Core.Tests/DynamicProxy.Tests/ClassProxyWithDefaultValuesTestCase.cs
@@ -1,80 +1,72 @@
-// Copyright 2004-2013 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.
-
-namespace Castle.DynamicProxy.Tests
-{
-	using System.Linq;
-
-	using Castle.DynamicProxy.Tests.Classes;
-	using Castle.DynamicProxy.Tests.Interceptors;
-
-	using CastleTests.DynamicProxy.Tests.Classes;
-	using CastleTests.DynamicProxy.Tests.Interfaces;
-
-	using NUnit.Framework;
-
-	[TestFixture]
-	public class ClassProxyWithDefaultValuesTestCase : BasePEVerifyTestCase
-	{
-#if DOTNET45
-		[Test]
-#if __MonoCS__
-		// Seems like mono is too strict, and doesn't handle a nullable default parameter in ParameterBuilder
-		// https://github.com/mono/mono/blob/master/mcs/class/corlib/System.Reflection.Emit/ParameterBuilder.cs#L101
-		[Ignore("System.ArgumentException : Constant does not match the defined type.")]
-#endif
-		public void MethodParameterWithDefaultValue_DefaultValueIsSetOnProxiedMethodAsWell()
-		{
-			var proxiedType = generator.CreateClassProxy<ClassWithMethodWithParameterWithDefaultValue>().GetType();
-
-			var parameter = proxiedType.GetMethod("Method").GetParameters().Single(paramInfo => paramInfo.Name == "value");
-
-			Assert.True(parameter.HasDefaultValue);
-			Assert.AreEqual(3, parameter.DefaultValue);
-		}
-
-		[Test]
-#if __MonoCS__
-		[Ignore("Expected: False  But was: True")]
-#endif
-		public void MethodParameterWithDefaultValue_DefaultValueNullIsSetOnProxiedMethodAsWell()
-		{
-			var proxiedType = generator.CreateClassProxy<ClassWithMethodWithParameterWithNullDefaultValue>().GetType();
-
-			var parameter = proxiedType.GetMethod("Method").GetParameters().Single(paramInfo => paramInfo.Name == "value");
-
-			Assert.False(parameter.HasDefaultValue);
-		}
-
-		[Test]
-		public void MethodParameterWithDefaultValue_UseNullDefaultValue_class_proxy()
-		{
-			var proxy = generator.CreateClassProxy<ClassWithMethodWithParameterWithNullDefaultValue>();
-			var result = proxy.Method();
-
-			Assert.IsTrue(result);
-		}
-
-		[Test]
-		public void MethodParameterWithDefaultValue_UseNullDefaultValue_interface_proxy()
-		{
-			var proxy = generator.CreateInterfaceProxyWithoutTarget<InterfaceWithMethodWithParameterWithNullDefaultValue>(
-					new SetReturnValueInterceptor(true));
-			var result = proxy.Method();
-
-			Assert.IsTrue(result);
-		}
-#endif
-	}
+// Copyright 2004-2013 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.
+
+namespace Castle.DynamicProxy.Tests
+{
+	using System.Linq;
+
+	using Castle.DynamicProxy.Tests.Classes;
+	using Castle.DynamicProxy.Tests.Interceptors;
+
+	using CastleTests.DynamicProxy.Tests.Classes;
+	using CastleTests.DynamicProxy.Tests.Interfaces;
+
+	using NUnit.Framework;
+
+	[TestFixture]
+	public class ClassProxyWithDefaultValuesTestCase : BasePEVerifyTestCase
+	{
+#if DOTNET45 && !__MonoCS__ // dotnet45 allows passing default parameter value to proxy, mono as earlier .net version do not
+		[Test]
+		public void MethodParameterWithDefaultValue_DefaultValueIsSetOnProxiedMethodAsWell()
+		{
+			var proxiedType = generator.CreateClassProxy<ClassWithMethodWithParameterWithDefaultValue>().GetType();
+
+			var parameter = proxiedType.GetMethod("Method").GetParameters().Single(paramInfo => paramInfo.Name == "value");
+
+			Assert.True(parameter.HasDefaultValue);
+			Assert.AreEqual(3, parameter.DefaultValue);
+		}
+
+		[Test]
+		public void MethodParameterWithDefaultValue_DefaultValueNullIsSetOnProxiedMethodAsWell()
+		{
+			var proxiedType = generator.CreateClassProxy<ClassWithMethodWithParameterWithNullDefaultValue>().GetType();
+
+			var parameter = proxiedType.GetMethod("Method").GetParameters().Single(paramInfo => paramInfo.Name == "value");
+
+			Assert.False(parameter.HasDefaultValue);
+		}
+
+		[Test]
+		public void MethodParameterWithDefaultValue_UseNullDefaultValue_class_proxy()
+		{
+			var proxy = generator.CreateClassProxy<ClassWithMethodWithParameterWithNullDefaultValue>();
+			var result = proxy.Method();
+
+			Assert.IsTrue(result);
+		}
+
+		[Test]
+		public void MethodParameterWithDefaultValue_UseNullDefaultValue_interface_proxy()
+		{
+			var proxy = generator.CreateInterfaceProxyWithoutTarget<InterfaceWithMethodWithParameterWithNullDefaultValue>(
+					new SetReturnValueInterceptor(true));
+			var result = proxy.Method();
+
+			Assert.IsTrue(result);
+		}
+#endif
+	}
 }
\ No newline at end of file
diff --git a/src/Castle.Core.Tests/DynamicProxy.Tests/InterfaceProxyWithMethodsWithOptionalParametersTestCase.cs b/src/Castle.Core.Tests/DynamicProxy.Tests/InterfaceProxyWithMethodsWithOptionalParametersTestCase.cs
index bd05f79..b7fe391 100644
--- a/src/Castle.Core.Tests/DynamicProxy.Tests/InterfaceProxyWithMethodsWithOptionalParametersTestCase.cs
+++ b/src/Castle.Core.Tests/DynamicProxy.Tests/InterfaceProxyWithMethodsWithOptionalParametersTestCase.cs
@@ -1,38 +1,33 @@
-ï»¿// 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 !DOTNET35 && !SILVERLIGHT
-namespace Castle.DynamicProxy.Tests
-{
-	using CastleTests.DynamicProxy.Tests.Interfaces;
-
-	using NUnit.Framework;
-
-	[TestFixture]
-	public class InterfaceProxyWithMethodsWithOptionalParametersTestCase
-	{
-		[Test]
-#if __MonoCS__
-		// Seems like mono is too strict, and doesn't handle a nullable default parameter in ParameterBuilder
-		// https://github.com/mono/mono/blob/master/mcs/class/corlib/System.Reflection.Emit/ParameterBuilder.cs#L101
-		[Ignore("System.ArgumentException : Constant does not match the defined type.")]
-#endif
-		public void CanCreateInterfaceProxy()
-		{
-			var proxyGenerator = new ProxyGenerator();
-			proxyGenerator.CreateInterfaceProxyWithoutTarget<InterfaceWithMethodsWithAllKindsOfOptionalParameters>();
-		}
-	}
-}
+ï»¿// 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 !DOTNET35 && !SILVERLIGHT
+namespace Castle.DynamicProxy.Tests
+{
+	using CastleTests.DynamicProxy.Tests.Interfaces;
+
+	using NUnit.Framework;
+
+	[TestFixture]
+	public class InterfaceProxyWithMethodsWithOptionalParametersTestCase
+	{
+		[Test]
+		public void CanCreateInterfaceProxy()
+		{
+			var proxyGenerator = new ProxyGenerator();
+			proxyGenerator.CreateInterfaceProxyWithoutTarget<InterfaceWithMethodsWithAllKindsOfOptionalParameters>();
+		}
+	}
+}
 #endif
\ No newline at end of file
diff --git a/src/Castle.Core.Tests/GenericClassProxyTestCase.cs b/src/Castle.Core.Tests/GenericClassProxyTestCase.cs
index da325cb..8fa9056 100644
--- a/src/Castle.Core.Tests/GenericClassProxyTestCase.cs
+++ b/src/Castle.Core.Tests/GenericClassProxyTestCase.cs
@@ -114,8 +114,9 @@ namespace Castle.DynamicProxy.Tests
 		}
 
 		[Test]
-		//		[Platform(Exclude = "mono", Reason = "Assertion at sgen-alloc.c:460, condition `*p == NULL' not met. " +
-//			"Fixed in https://bugzilla.xamarin.com/show_bug.cgi?id=28182")]
+#if __MonoCS__
+		[Ignore ("System.Type.GetTypeInfo().IsByRef throws a System.InvalidCastException on mono 4.0.2")]
+#endif
 		public void ProxyWithMethodReturningGenericOfGenericOfT ()
 		{
 			var proxy = generator.CreateClassProxy<ClassWithMethodWithReturnArrayOfListOfT> ();
@@ -124,9 +125,6 @@ namespace Castle.DynamicProxy.Tests
 		}
 
 		[Test]
-#if __MonoCS__
-		[Ignore ("System.Type[] doesn't implement interface Castle.DynamicProxy.IInvocation")]
-		#endif
 		public void ProxyWithGenericArgumentsAndMethodGenericArguments ()
 		{
 			GenClassWithGenMethods<List<object>> proxy =
@@ -142,9 +140,6 @@ namespace Castle.DynamicProxy.Tests
 		}
 
 		[Test]
-#if __MonoCS__
-		[Ignore ("System.Type[] doesn't implement interface Castle.DynamicProxy.IInvocation")]
-		#endif
 		public void ProxyWithGenericArgumentsAndMethodGenericArgumentsWithConstraints ()
 		{
 			GenClassWithGenMethodsConstrained<List<object>> proxy =
@@ -160,9 +155,6 @@ namespace Castle.DynamicProxy.Tests
 		}
 
 		[Test]
-#if __MonoCS__
-		[Ignore ("System.Type[] doesn't implement interface Castle.DynamicProxy.IInvocation")]
-		#endif
 		public void ProxyWithGenericArgumentsAndMethodGenericArgumentsWithOneNotDefinedOnType ()
 		{
 			GenClassWithGenMethods<List<object>> proxy =
@@ -214,9 +206,6 @@ namespace Castle.DynamicProxy.Tests
 		}
 
 		[Test]
-#if __MonoCS__
-		[Ignore ("System.Type[] doesn't implement interface Castle.DynamicProxy.IInvocation")]
-		#endif
 		public void ClassWithGenMethodOnly ()
 		{
 			OnlyGenMethodsClass proxy =
@@ -231,9 +220,6 @@ namespace Castle.DynamicProxy.Tests
 		}
 
 		[Test]
-#if __MonoCS__
-		[Ignore ("System.Type[] doesn't implement interface Castle.DynamicProxy.IInvocation")]
-		#endif
 		public void MethodInfoClosedInGenTypeGenMethodRefType ()
 		{
 			KeepDataInterceptor interceptor = new KeepDataInterceptor ();
@@ -249,9 +235,6 @@ namespace Castle.DynamicProxy.Tests
 		}
 
 		[Test]
-#if __MonoCS__
-		[Ignore ("System.Type[] doesn't implement interface Castle.DynamicProxy.IInvocation")]
-		#endif
 		public void MethodInfoClosedInGenTypeGenMethodValueType ()
 		{
 			KeepDataInterceptor interceptor = new KeepDataInterceptor ();
@@ -315,9 +298,6 @@ namespace Castle.DynamicProxy.Tests
 		}
 
 		[Test]
-#if __MonoCS__
-		[Ignore ("System.Type[] doesn't implement interface Castle.DynamicProxy.IInvocation")]
-		#endif
 		public void MethodInfoClosedInNongenTypeGenMethod ()
 		{
 			KeepDataInterceptor interceptor = new KeepDataInterceptor ();
diff --git a/src/Castle.Core.Tests/GenericInterfaceProxyTestCase.cs b/src/Castle.Core.Tests/GenericInterfaceProxyTestCase.cs
index 1ea9ee6..ec6e91a 100644
--- a/src/Castle.Core.Tests/GenericInterfaceProxyTestCase.cs
+++ b/src/Castle.Core.Tests/GenericInterfaceProxyTestCase.cs
@@ -1,467 +1,449 @@
-// Copyright 2004-2013 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.
-
-namespace Castle.DynamicProxy.Tests
-{
-	using System;
-	using System.Collections.Generic;
-	using System.Reflection;
-
-	using Castle.DynamicProxy.Generators;
-	using Castle.DynamicProxy.Tests.GenInterfaces;
-	using Castle.DynamicProxy.Tests.Interceptors;
-	using Castle.DynamicProxy.Tests.Interfaces;
-	using NUnit.Framework;
-
-	[TestFixture]
-	public class GenericInterfaceProxyTestCase : BasePEVerifyTestCase
-	{
-		private LogInvocationInterceptor logger;
-
-		public override void Init()
-		{
-			base.Init();
-			logger = new LogInvocationInterceptor();
-		}
-
-		[Test]
-		public void Type_has_constraint_T_on_interface_method_has_constraint_T1_on_T()
-		{
-			generator.CreateInterfaceProxyWithoutTarget
-				<IGenericInterfaceWithGenericMethodWithCascadingConstraintOnInterface<IEmpty>>();
-		}
-
-		[Test]
-		public void Type_has_constraint_T_on_class_method_has_constraint_T1_on_T()
-		{
-			generator.CreateInterfaceProxyWithoutTarget<IGenericInterfaceWithGenericMethodWithCascadingConstraintOnClass<Empty>>();
-		}
-
-		[Test]
-		public void Type_has_constraint_T_on_reference_type_method_has_constraint_T1_on_T()
-		{
-			generator.CreateInterfaceProxyWithoutTarget
-				<IGenericInterfaceWithGenericMethodWithCascadingConstraintOnAnyReferenceType<Empty>>();
-		}
-
-		[Test]
-		public void Type_has_constraint_T_on_type_with_default_ctor_method_has_constraint_T1_on_T()
-		{
-			generator.CreateInterfaceProxyWithoutTarget
-				<IGenericInterfaceWithGenericMethodWithCascadingConstraintOnAnyTypeWithDefaultConstructor<Empty>>();
-		}
-
-		[Test]
-		public void ProxyWithGenericArgument()
-		{
-			var proxy =
-				generator.CreateInterfaceProxyWithTarget<GenInterface<int>>(
-					new GenInterfaceImpl<int>(), logger);
-
-			Assert.IsNotNull(proxy);
-
-			Assert.AreEqual(1, proxy.DoSomething(1));
-
-			Assert.AreEqual("DoSomething ", logger.LogContents);
-		}
-
-		[Test]
-		public void Proxy_with_method_with_nested_generic_parameter()
-		{
-			var interceptors = new SetReturnValueInterceptor(null);
-			var proxy =
-				generator.CreateInterfaceProxyWithoutTarget<GenInterfaceWithMethodWithNestedGenericParameter>(interceptors);
-			proxy.Foo<int>(null);
-		}
-
-		[Test]
-		public void Proxy_with_method_with_nested_generic_parameter_by_ref()
-		{
-			var interceptors = new SetReturnValueInterceptor(null);
-			var proxy =
-				generator.CreateInterfaceProxyWithoutTarget<GenInterfaceWithMethodWithNestedGenericParameterByRef>(interceptors);
-			IEnumerable<IComparable<int>> param = null;
-			proxy.Foo(ref param);
-		}
-
-		[Test]
-		public void Proxy_with_method_with_nested_generic_return()
-		{
-			var interceptors = new SetReturnValueInterceptor(null);
-			var proxy =
-				generator.CreateInterfaceProxyWithoutTarget<GenInterfaceWithMethodWithNestedGenericReturn>(interceptors);
-			proxy.Foo<int>();
-		}
-
-		[Test]
-		public void ProxyWithGenericArgumentAndGenericMethod()
-		{
-			var proxy =
-				generator.CreateInterfaceProxyWithTarget<GenInterfaceWithGenMethods<int>>(
-					new GenInterfaceWithGenMethodsImpl<int>(), logger);
-
-			Assert.IsNotNull(proxy);
-
-			proxy.DoSomething(10L, 1);
-
-			Assert.AreEqual("DoSomething ", logger.LogContents);
-		}
-
-		[Test]
-		public void ProxyWithGenericArgumentAndGenericMethodAndGenericReturn()
-		{
-			var proxy =
-				generator.CreateInterfaceProxyWithTarget<GenInterfaceWithGenMethodsAndGenReturn<int>>(
-					new GenInterfaceWithGenMethodsAndGenReturnImpl<int>(), logger);
-
-			Assert.IsNotNull(proxy);
-
-			Assert.AreEqual(10L, proxy.DoSomething(10L, 1));
-
-			Assert.AreEqual("DoSomething ", logger.LogContents);
-		}
-
-		[Test]
-		public void ProxyWithGenInterfaceWithGenericArrays()
-		{
-			var proxy =
-				generator.CreateInterfaceProxyWithTarget<IGenInterfaceWithGenArray<int>>(
-					new GenInterfaceWithGenArray<int>(), logger);
-
-			Assert.IsNotNull(proxy);
-
-			var items = new[] { 1, 2, 3 };
-			proxy.CopyTo(items);
-			items = proxy.CreateItems();
-			Assert.IsNotNull(items);
-			Assert.AreEqual(3, items.Length);
-
-			Assert.AreEqual("CopyTo CreateItems ", logger.LogContents);
-		}
-
-		[Test]
-		public void ProxyWithGenInterfaceWithBase()
-		{
-			var proxy =
-				generator.CreateInterfaceProxyWithTarget<IGenInterfaceHierarchySpecialization<int>>(
-					new GenInterfaceHierarchy<int>(), logger);
-
-			Assert.IsNotNull(proxy);
-
-			proxy.Add();
-			proxy.Add(1);
-			Assert.IsNotNull(proxy.FetchAll());
-
-			Assert.AreEqual("Add Add FetchAll ", logger.LogContents);
-		}
-
-		[Test]
-		public void ProxyWithGenExplicitImplementation()
-		{
-			var target = generator.CreateInterfaceProxyWithTarget<InterfaceWithExplicitImpl<int>>(
-				new GenExplicitImplementation<int>(), logger);
-			var enumerator = target.GetEnum1();
-			Assert.IsNotNull(enumerator);
-		}
-
-		[Test]
-		public void TwoGenericsInterfaceWithoutTarget()
-		{
-			generator.CreateInterfaceProxyWithoutTarget(typeof(GenInterface<object>),
-			                                            new[] { typeof(InterfaceWithExplicitImpl<int>) },
-			                                            new LogInvocationInterceptor());
-		}
-
-		[Test]
-		public void NonGenInterfaceWithParentGenClassImplementingGenInterface()
-		{
-			generator.CreateInterfaceProxyWithoutTarget(typeof(IUserRepository),
-			                                            new[] { typeof(InterfaceWithExplicitImpl<int>) },
-			                                            new LogInvocationInterceptor());
-		}
-
-		[Test]
-		public void WithoutTarget()
-		{
-			generator.CreateInterfaceProxyWithoutTarget(typeof(InterfaceWithExplicitImpl<int>), new LogInvocationInterceptor());
-		}
-
-		[Test]
-#if __MonoCS__
-		[Ignore("System.Type[] doesn't implement interface Castle.DynamicProxy.IInvocation")]
-#endif
-		public void MethodInfoClosedInGenIfcGenMethodRefTypeNoTarget()
-		{
-			var interceptor = new KeepDataInterceptor();
-			var proxy = generator.CreateInterfaceProxyWithoutTarget<GenInterfaceWithGenMethods<List<object>>>(interceptor);
-
-			proxy.DoSomething(1, null);
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void), typeof(int),
-			                                           typeof(List<object>));
-			Assert.AreEqual(null, interceptor.Invocation.GetConcreteMethodInvocationTarget());
-
-			proxy.DoSomething(new List<object>(), new List<object>());
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void),
-			                                           typeof(List<object>), typeof(List<object>));
-			Assert.AreEqual(null, interceptor.Invocation.GetConcreteMethodInvocationTarget());
-		}
-
-		[Test]
-#if __MonoCS__
-		[Ignore("System.Type[] doesn't implement interface Castle.DynamicProxy.IInvocation")]
-#endif
-		public void MethodInfoClosedInGenIfcGenMethodValueTypeNoTarget()
-		{
-			var interceptor = new KeepDataInterceptor();
-			var proxy =
-				generator.CreateInterfaceProxyWithoutTarget<GenInterfaceWithGenMethods<int>>(interceptor);
-
-			proxy.DoSomething(1, 1);
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void), typeof(int),
-			                                           typeof(int));
-
-			proxy.DoSomething(new List<object>(), 1);
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void),
-			                                           typeof(List<object>), typeof(int));
-		}
-
-		[Test]
-		public void MethodInfoClosedInGenIfcNongenMethodRefTypeNoTarget()
-		{
-			var interceptor = new KeepDataInterceptor();
-			var proxy =
-				generator.CreateInterfaceProxyWithoutTarget<IGenInterfaceHierarchyBase<List<object>>>(interceptor);
-
-			proxy.Get();
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(List<object>));
-
-			proxy.Add(null);
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void),
-			                                           typeof(List<object>));
-		}
-
-		[Test]
-		public void MethodInfoClosedInGenIfcNongenMethodValueTypeNoTarget()
-		{
-			var interceptor = new KeepDataInterceptor();
-			var proxy =
-				generator.CreateInterfaceProxyWithoutTarget<IGenInterfaceHierarchyBase<int>>(interceptor);
-
-			proxy.Get();
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(int));
-
-			proxy.Add(0);
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void), typeof(int));
-		}
-
-		[Test]
-#if __MonoCS__
-		[Ignore("System.Type[] doesn't implement interface Castle.DynamicProxy.IInvocation")]
-#endif
-		public void MethodInfoClosedInNongenIfcGenMethodNoTarget()
-		{
-			var interceptor = new KeepDataInterceptor();
-			var proxy = generator.CreateInterfaceProxyWithoutTarget<OnlyGenMethodsInterface>(interceptor);
-
-			proxy.DoSomething(1);
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(int), typeof(int));
-
-			proxy.DoSomething(new List<object>());
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(List<object>),
-			                                           typeof(List<object>));
-		}
-
-		[Test]
-#if __MonoCS__
-		[Ignore("System.Type[] doesn't implement interface Castle.DynamicProxy.IInvocation")]
-#endif
-		public void MethodInfoClosedInGenIfcGenMethodRefTypeWithTarget()
-		{
-			var interceptor = new KeepDataInterceptor();
-			GenInterfaceWithGenMethods<List<object>> target = new GenInterfaceWithGenMethodsImpl<List<object>>();
-			var proxy =
-				generator.CreateInterfaceProxyWithTarget(target, interceptor);
-
-			proxy.DoSomething(1, null);
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void), typeof(int),
-			                                           typeof(List<object>));
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(void),
-			                                           typeof(int), typeof(List<object>));
-			Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
-			                   interceptor.Invocation.GetConcreteMethodInvocationTarget());
-
-			proxy.DoSomething(new List<object>(), new List<object>());
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void),
-			                                           typeof(List<object>), typeof(List<object>));
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(void),
-			                                           typeof(List<object>), typeof(List<object>));
-			Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
-			                   interceptor.Invocation.GetConcreteMethodInvocationTarget());
-		}
-
-		[Test]
-#if __MonoCS__
-		[Ignore("System.Type[] doesn't implement interface Castle.DynamicProxy.IInvocation")]
-#endif
-		public void MethodInfoClosedInGenIfcGenMethodValueTypeWithTarget()
-		{
-			var interceptor = new KeepDataInterceptor();
-			GenInterfaceWithGenMethods<int> target = new GenInterfaceWithGenMethodsImpl<int>();
-			var proxy =
-				generator.CreateInterfaceProxyWithTarget(target, interceptor);
-
-			proxy.DoSomething(1, 1);
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void), typeof(int),
-			                                           typeof(int));
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(void),
-			                                           typeof(int), typeof(int));
-			Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
-			                   interceptor.Invocation.GetConcreteMethodInvocationTarget());
-
-			proxy.DoSomething(new List<object>(), 1);
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void),
-			                                           typeof(List<object>), typeof(int));
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(void),
-			                                           typeof(List<object>), typeof(int));
-			Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
-			                   interceptor.Invocation.GetConcreteMethodInvocationTarget());
-		}
-
-		[Test]
-		public void MethodInfoClosedInGenIfcNongenMethodRefTypeWithTarget()
-		{
-			var interceptor = new KeepDataInterceptor();
-			IGenInterfaceHierarchyBase<List<object>> target = new GenInterfaceHierarchy<List<object>>();
-			var proxy =
-				generator.CreateInterfaceProxyWithTarget(target, interceptor);
-
-			proxy.Add(null);
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void),
-			                                           typeof(List<object>));
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(void),
-			                                           typeof(List<object>));
-			Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
-			                   interceptor.Invocation.GetConcreteMethodInvocationTarget());
-
-			proxy.Get();
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(List<object>));
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(),
-			                                           typeof(List<object>));
-			Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
-			                   interceptor.Invocation.GetConcreteMethodInvocationTarget());
-		}
-
-		[Test]
-		public void MethodInfoClosedInGenIfcNongenMethodValueTypeWithTarget()
-		{
-			var interceptor = new KeepDataInterceptor();
-			IGenInterfaceHierarchyBase<int> target = new GenInterfaceHierarchy<int>();
-			var proxy =
-				generator.CreateInterfaceProxyWithTarget(target, interceptor);
-
-			proxy.Add(0);
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void), typeof(int));
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(void),
-			                                           typeof(int));
-			Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
-			                   interceptor.Invocation.GetConcreteMethodInvocationTarget());
-
-			proxy.Get();
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(int));
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(int));
-			Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
-			                   interceptor.Invocation.GetConcreteMethodInvocationTarget());
-		}
-
-		[Test]
-#if __MonoCS__
-		[Ignore("System.Type[] doesn't implement interface Castle.DynamicProxy.IInvocation")]
-#endif
-		public void MethodInfoClosedInNongenIfcGenMethodWithTarget()
-		{
-			var interceptor = new KeepDataInterceptor();
-			OnlyGenMethodsInterface target = new OnlyGenMethodsInterfaceImpl();
-			var proxy =
-				generator.CreateInterfaceProxyWithTarget(target, interceptor);
-
-			proxy.DoSomething(1);
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(int), typeof(int));
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(int),
-			                                           typeof(int));
-			Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
-			                   interceptor.Invocation.GetConcreteMethodInvocationTarget());
-
-			proxy.DoSomething(new List<object>());
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(List<object>),
-			                                           typeof(List<object>));
-			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(),
-			                                           typeof(List<object>), typeof(List<object>));
-			Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
-			                   interceptor.Invocation.GetConcreteMethodInvocationTarget());
-		}
-
-		[Test]
-		[ExpectedException(typeof(GeneratorException))]
-		public void ThrowsWhenProxyingGenericTypeDefNoTarget()
-		{
-			var interceptor = new KeepDataInterceptor();
-			var o = generator.CreateInterfaceProxyWithoutTarget(typeof(IGenInterfaceHierarchyBase<>), interceptor);
-		}
-
-		[Test(Description = "There is a strange CLR bug resulting from our loading the tokens of methods in generic types. "
-		                    + "This test ensures we do not trigger it.")]
-		//[Ignore("Currently, we trigger the bug, and work around it - see MethodFinder")]
-		public void TypeGetMethodsIsStable()
-		{
-			ProxyWithGenInterfaceWithBase();
-			Assert.AreEqual(4, typeof(IGenInterfaceHierarchyBase<int>).GetMethods().Length);
-		}
-
-		[Test(Description = "There is a strange CLR bug resulting from our loading the tokens of methods in generic types. "
-		                    + "This test ensures we correctly work around it.")]
-		public void MethodFinderIsStable()
-		{
-			ProxyWithGenInterfaceWithBase();
-			Assert.AreEqual(4,
-			                MethodFinder.GetAllInstanceMethods(typeof(IGenInterfaceHierarchyBase<int>),
-			                                                   BindingFlags.Public | BindingFlags.Instance).Length);
-		}
-
-		[Test(Description = "There is a strange CLR bug resulting from our loading the tokens of methods in generic types. "
-		                    +
-		                    "This test ensures we do not trigger it across AppDomains. If we do, MethodFinder must provide a cross-AppDomain workaround."
-			)]
-#if SILVERLIGHT
-		[Ignore("Cannot create seperate AppDomain in silverlight.")]
-		public void TypeGetMethodsIsStableInDifferentAppDomains()
-		{
-		}
-#else
-		public void TypeGetMethodsIsStableInDifferentAppDomains()
-		{
-			ProxyWithGenInterfaceWithBase();
-			var newDomain =
-				AppDomain.CreateDomain("NewDomain", AppDomain.CurrentDomain.Evidence, AppDomain.CurrentDomain.SetupInformation);
-			try
-			{
-				newDomain.DoCallBack(delegate { Assert.AreEqual(4, typeof(IGenInterfaceHierarchyBase<int>).GetMethods().Length); });
-			}
-			finally
-			{
-				AppDomain.Unload(newDomain);
-			}
-		}
-#endif
-	}
+// Copyright 2004-2013 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.
+
+namespace Castle.DynamicProxy.Tests
+{
+	using System;
+	using System.Collections.Generic;
+	using System.Reflection;
+
+	using Castle.DynamicProxy.Generators;
+	using Castle.DynamicProxy.Tests.GenInterfaces;
+	using Castle.DynamicProxy.Tests.Interceptors;
+	using Castle.DynamicProxy.Tests.Interfaces;
+	using NUnit.Framework;
+
+	[TestFixture]
+	public class GenericInterfaceProxyTestCase : BasePEVerifyTestCase
+	{
+		private LogInvocationInterceptor logger;
+
+		public override void Init()
+		{
+			base.Init();
+			logger = new LogInvocationInterceptor();
+		}
+
+		[Test]
+		public void Type_has_constraint_T_on_interface_method_has_constraint_T1_on_T()
+		{
+			generator.CreateInterfaceProxyWithoutTarget
+				<IGenericInterfaceWithGenericMethodWithCascadingConstraintOnInterface<IEmpty>>();
+		}
+
+		[Test]
+		public void Type_has_constraint_T_on_class_method_has_constraint_T1_on_T()
+		{
+			generator.CreateInterfaceProxyWithoutTarget<IGenericInterfaceWithGenericMethodWithCascadingConstraintOnClass<Empty>>();
+		}
+
+		[Test]
+		public void Type_has_constraint_T_on_reference_type_method_has_constraint_T1_on_T()
+		{
+			generator.CreateInterfaceProxyWithoutTarget
+				<IGenericInterfaceWithGenericMethodWithCascadingConstraintOnAnyReferenceType<Empty>>();
+		}
+
+		[Test]
+		public void Type_has_constraint_T_on_type_with_default_ctor_method_has_constraint_T1_on_T()
+		{
+			generator.CreateInterfaceProxyWithoutTarget
+				<IGenericInterfaceWithGenericMethodWithCascadingConstraintOnAnyTypeWithDefaultConstructor<Empty>>();
+		}
+
+		[Test]
+		public void ProxyWithGenericArgument()
+		{
+			var proxy =
+				generator.CreateInterfaceProxyWithTarget<GenInterface<int>>(
+					new GenInterfaceImpl<int>(), logger);
+
+			Assert.IsNotNull(proxy);
+
+			Assert.AreEqual(1, proxy.DoSomething(1));
+
+			Assert.AreEqual("DoSomething ", logger.LogContents);
+		}
+
+		[Test]
+		public void Proxy_with_method_with_nested_generic_parameter()
+		{
+			var interceptors = new SetReturnValueInterceptor(null);
+			var proxy =
+				generator.CreateInterfaceProxyWithoutTarget<GenInterfaceWithMethodWithNestedGenericParameter>(interceptors);
+			proxy.Foo<int>(null);
+		}
+
+		[Test]
+		public void Proxy_with_method_with_nested_generic_parameter_by_ref()
+		{
+			var interceptors = new SetReturnValueInterceptor(null);
+			var proxy =
+				generator.CreateInterfaceProxyWithoutTarget<GenInterfaceWithMethodWithNestedGenericParameterByRef>(interceptors);
+			IEnumerable<IComparable<int>> param = null;
+			proxy.Foo(ref param);
+		}
+
+		[Test]
+		public void Proxy_with_method_with_nested_generic_return()
+		{
+			var interceptors = new SetReturnValueInterceptor(null);
+			var proxy =
+				generator.CreateInterfaceProxyWithoutTarget<GenInterfaceWithMethodWithNestedGenericReturn>(interceptors);
+			proxy.Foo<int>();
+		}
+
+		[Test]
+		public void ProxyWithGenericArgumentAndGenericMethod()
+		{
+			var proxy =
+				generator.CreateInterfaceProxyWithTarget<GenInterfaceWithGenMethods<int>>(
+					new GenInterfaceWithGenMethodsImpl<int>(), logger);
+
+			Assert.IsNotNull(proxy);
+
+			proxy.DoSomething(10L, 1);
+
+			Assert.AreEqual("DoSomething ", logger.LogContents);
+		}
+
+		[Test]
+		public void ProxyWithGenericArgumentAndGenericMethodAndGenericReturn()
+		{
+			var proxy =
+				generator.CreateInterfaceProxyWithTarget<GenInterfaceWithGenMethodsAndGenReturn<int>>(
+					new GenInterfaceWithGenMethodsAndGenReturnImpl<int>(), logger);
+
+			Assert.IsNotNull(proxy);
+
+			Assert.AreEqual(10L, proxy.DoSomething(10L, 1));
+
+			Assert.AreEqual("DoSomething ", logger.LogContents);
+		}
+
+		[Test]
+		public void ProxyWithGenInterfaceWithGenericArrays()
+		{
+			var proxy =
+				generator.CreateInterfaceProxyWithTarget<IGenInterfaceWithGenArray<int>>(
+					new GenInterfaceWithGenArray<int>(), logger);
+
+			Assert.IsNotNull(proxy);
+
+			var items = new[] { 1, 2, 3 };
+			proxy.CopyTo(items);
+			items = proxy.CreateItems();
+			Assert.IsNotNull(items);
+			Assert.AreEqual(3, items.Length);
+
+			Assert.AreEqual("CopyTo CreateItems ", logger.LogContents);
+		}
+
+		[Test]
+		public void ProxyWithGenInterfaceWithBase()
+		{
+			var proxy =
+				generator.CreateInterfaceProxyWithTarget<IGenInterfaceHierarchySpecialization<int>>(
+					new GenInterfaceHierarchy<int>(), logger);
+
+			Assert.IsNotNull(proxy);
+
+			proxy.Add();
+			proxy.Add(1);
+			Assert.IsNotNull(proxy.FetchAll());
+
+			Assert.AreEqual("Add Add FetchAll ", logger.LogContents);
+		}
+
+		[Test]
+		public void ProxyWithGenExplicitImplementation()
+		{
+			var target = generator.CreateInterfaceProxyWithTarget<InterfaceWithExplicitImpl<int>>(
+				new GenExplicitImplementation<int>(), logger);
+			var enumerator = target.GetEnum1();
+			Assert.IsNotNull(enumerator);
+		}
+
+		[Test]
+		public void TwoGenericsInterfaceWithoutTarget()
+		{
+			generator.CreateInterfaceProxyWithoutTarget(typeof(GenInterface<object>),
+			                                            new[] { typeof(InterfaceWithExplicitImpl<int>) },
+			                                            new LogInvocationInterceptor());
+		}
+
+		[Test]
+		public void NonGenInterfaceWithParentGenClassImplementingGenInterface()
+		{
+			generator.CreateInterfaceProxyWithoutTarget(typeof(IUserRepository),
+			                                            new[] { typeof(InterfaceWithExplicitImpl<int>) },
+			                                            new LogInvocationInterceptor());
+		}
+
+		[Test]
+		public void WithoutTarget()
+		{
+			generator.CreateInterfaceProxyWithoutTarget(typeof(InterfaceWithExplicitImpl<int>), new LogInvocationInterceptor());
+		}
+
+		[Test]
+		public void MethodInfoClosedInGenIfcGenMethodRefTypeNoTarget()
+		{
+			var interceptor = new KeepDataInterceptor();
+			var proxy = generator.CreateInterfaceProxyWithoutTarget<GenInterfaceWithGenMethods<List<object>>>(interceptor);
+
+			proxy.DoSomething(1, null);
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void), typeof(int),
+			                                           typeof(List<object>));
+			Assert.AreEqual(null, interceptor.Invocation.GetConcreteMethodInvocationTarget());
+
+			proxy.DoSomething(new List<object>(), new List<object>());
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void),
+			                                           typeof(List<object>), typeof(List<object>));
+			Assert.AreEqual(null, interceptor.Invocation.GetConcreteMethodInvocationTarget());
+		}
+
+		[Test]
+		public void MethodInfoClosedInGenIfcGenMethodValueTypeNoTarget()
+		{
+			var interceptor = new KeepDataInterceptor();
+			var proxy =
+				generator.CreateInterfaceProxyWithoutTarget<GenInterfaceWithGenMethods<int>>(interceptor);
+
+			proxy.DoSomething(1, 1);
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void), typeof(int),
+			                                           typeof(int));
+
+			proxy.DoSomething(new List<object>(), 1);
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void),
+			                                           typeof(List<object>), typeof(int));
+		}
+
+		[Test]
+		public void MethodInfoClosedInGenIfcNongenMethodRefTypeNoTarget()
+		{
+			var interceptor = new KeepDataInterceptor();
+			var proxy =
+				generator.CreateInterfaceProxyWithoutTarget<IGenInterfaceHierarchyBase<List<object>>>(interceptor);
+
+			proxy.Get();
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(List<object>));
+
+			proxy.Add(null);
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void),
+			                                           typeof(List<object>));
+		}
+
+		[Test]
+		public void MethodInfoClosedInGenIfcNongenMethodValueTypeNoTarget()
+		{
+			var interceptor = new KeepDataInterceptor();
+			var proxy =
+				generator.CreateInterfaceProxyWithoutTarget<IGenInterfaceHierarchyBase<int>>(interceptor);
+
+			proxy.Get();
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(int));
+
+			proxy.Add(0);
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void), typeof(int));
+		}
+
+		[Test]
+		public void MethodInfoClosedInNongenIfcGenMethodNoTarget()
+		{
+			var interceptor = new KeepDataInterceptor();
+			var proxy = generator.CreateInterfaceProxyWithoutTarget<OnlyGenMethodsInterface>(interceptor);
+
+			proxy.DoSomething(1);
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(int), typeof(int));
+
+			proxy.DoSomething(new List<object>());
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(List<object>),
+			                                           typeof(List<object>));
+		}
+
+		[Test]
+		public void MethodInfoClosedInGenIfcGenMethodRefTypeWithTarget()
+		{
+			var interceptor = new KeepDataInterceptor();
+			GenInterfaceWithGenMethods<List<object>> target = new GenInterfaceWithGenMethodsImpl<List<object>>();
+			var proxy =
+				generator.CreateInterfaceProxyWithTarget(target, interceptor);
+
+			proxy.DoSomething(1, null);
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void), typeof(int),
+			                                           typeof(List<object>));
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(void),
+			                                           typeof(int), typeof(List<object>));
+			Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
+			                   interceptor.Invocation.GetConcreteMethodInvocationTarget());
+
+			proxy.DoSomething(new List<object>(), new List<object>());
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void),
+			                                           typeof(List<object>), typeof(List<object>));
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(void),
+			                                           typeof(List<object>), typeof(List<object>));
+			Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
+			                   interceptor.Invocation.GetConcreteMethodInvocationTarget());
+		}
+
+		[Test]
+		public void MethodInfoClosedInGenIfcGenMethodValueTypeWithTarget()
+		{
+			var interceptor = new KeepDataInterceptor();
+			GenInterfaceWithGenMethods<int> target = new GenInterfaceWithGenMethodsImpl<int>();
+			var proxy =
+				generator.CreateInterfaceProxyWithTarget(target, interceptor);
+
+			proxy.DoSomething(1, 1);
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void), typeof(int),
+			                                           typeof(int));
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(void),
+			                                           typeof(int), typeof(int));
+			Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
+			                   interceptor.Invocation.GetConcreteMethodInvocationTarget());
+
+			proxy.DoSomething(new List<object>(), 1);
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void),
+			                                           typeof(List<object>), typeof(int));
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(void),
+			                                           typeof(List<object>), typeof(int));
+			Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
+			                   interceptor.Invocation.GetConcreteMethodInvocationTarget());
+		}
+
+		[Test]
+		public void MethodInfoClosedInGenIfcNongenMethodRefTypeWithTarget()
+		{
+			var interceptor = new KeepDataInterceptor();
+			IGenInterfaceHierarchyBase<List<object>> target = new GenInterfaceHierarchy<List<object>>();
+			var proxy =
+				generator.CreateInterfaceProxyWithTarget(target, interceptor);
+
+			proxy.Add(null);
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void),
+			                                           typeof(List<object>));
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(void),
+			                                           typeof(List<object>));
+			Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
+			                   interceptor.Invocation.GetConcreteMethodInvocationTarget());
+
+			proxy.Get();
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(List<object>));
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(),
+			                                           typeof(List<object>));
+			Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
+			                   interceptor.Invocation.GetConcreteMethodInvocationTarget());
+		}
+
+		[Test]
+		public void MethodInfoClosedInGenIfcNongenMethodValueTypeWithTarget()
+		{
+			var interceptor = new KeepDataInterceptor();
+			IGenInterfaceHierarchyBase<int> target = new GenInterfaceHierarchy<int>();
+			var proxy =
+				generator.CreateInterfaceProxyWithTarget(target, interceptor);
+
+			proxy.Add(0);
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(void), typeof(int));
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(void),
+			                                           typeof(int));
+			Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
+			                   interceptor.Invocation.GetConcreteMethodInvocationTarget());
+
+			proxy.Get();
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(int));
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(int));
+			Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
+			                   interceptor.Invocation.GetConcreteMethodInvocationTarget());
+		}
+
+		[Test]
+		public void MethodInfoClosedInNongenIfcGenMethodWithTarget()
+		{
+			var interceptor = new KeepDataInterceptor();
+			OnlyGenMethodsInterface target = new OnlyGenMethodsInterfaceImpl();
+			var proxy =
+				generator.CreateInterfaceProxyWithTarget(target, interceptor);
+
+			proxy.DoSomething(1);
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(int), typeof(int));
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(), typeof(int),
+			                                           typeof(int));
+			Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
+			                   interceptor.Invocation.GetConcreteMethodInvocationTarget());
+
+			proxy.DoSomething(new List<object>());
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethod(), typeof(List<object>),
+			                                           typeof(List<object>));
+			GenericTestUtility.CheckMethodInfoIsClosed(interceptor.Invocation.GetConcreteMethodInvocationTarget(),
+			                                           typeof(List<object>), typeof(List<object>));
+			Assert.AreNotEqual(interceptor.Invocation.GetConcreteMethod(),
+			                   interceptor.Invocation.GetConcreteMethodInvocationTarget());
+		}
+
+		[Test]
+		[ExpectedException(typeof(GeneratorException))]
+		public void ThrowsWhenProxyingGenericTypeDefNoTarget()
+		{
+			var interceptor = new KeepDataInterceptor();
+			var o = generator.CreateInterfaceProxyWithoutTarget(typeof(IGenInterfaceHierarchyBase<>), interceptor);
+		}
+
+		[Test(Description = "There is a strange CLR bug resulting from our loading the tokens of methods in generic types. "
+		                    + "This test ensures we do not trigger it.")]
+		//[Ignore("Currently, we trigger the bug, and work around it - see MethodFinder")]
+		public void TypeGetMethodsIsStable()
+		{
+			ProxyWithGenInterfaceWithBase();
+			Assert.AreEqual(4, typeof(IGenInterfaceHierarchyBase<int>).GetMethods().Length);
+		}
+
+		[Test(Description = "There is a strange CLR bug resulting from our loading the tokens of methods in generic types. "
+		                    + "This test ensures we correctly work around it.")]
+		public void MethodFinderIsStable()
+		{
+			ProxyWithGenInterfaceWithBase();
+			Assert.AreEqual(4,
+			                MethodFinder.GetAllInstanceMethods(typeof(IGenInterfaceHierarchyBase<int>),
+			                                                   BindingFlags.Public | BindingFlags.Instance).Length);
+		}
+
+		[Test(Description = "There is a strange CLR bug resulting from our loading the tokens of methods in generic types. "
+		                    +
+		                    "This test ensures we do not trigger it across AppDomains. If we do, MethodFinder must provide a cross-AppDomain workaround."
+			)]
+#if SILVERLIGHT
+		[Ignore("Cannot create seperate AppDomain in silverlight.")]
+		public void TypeGetMethodsIsStableInDifferentAppDomains()
+		{
+		}
+#else
+		public void TypeGetMethodsIsStableInDifferentAppDomains()
+		{
+			ProxyWithGenInterfaceWithBase();
+			var newDomain =
+				AppDomain.CreateDomain("NewDomain", AppDomain.CurrentDomain.Evidence, AppDomain.CurrentDomain.SetupInformation);
+			try
+			{
+				newDomain.DoCallBack(delegate { Assert.AreEqual(4, typeof(IGenInterfaceHierarchyBase<int>).GetMethods().Length); });
+			}
+			finally
+			{
+				AppDomain.Unload(newDomain);
+			}
+		}
+#endif
+	}
 }
\ No newline at end of file
diff --git a/src/Castle.Core.Tests/GenericMethodsProxyTestCase.cs b/src/Castle.Core.Tests/GenericMethodsProxyTestCase.cs
index a312a40..c8c89f5 100644
--- a/src/Castle.Core.Tests/GenericMethodsProxyTestCase.cs
+++ b/src/Castle.Core.Tests/GenericMethodsProxyTestCase.cs
@@ -36,9 +36,6 @@ namespace Castle.DynamicProxy.Tests
 		}
 
 		[Test]
-#if __MonoCS__
-		[Ignore ("System.Type[] doesn't implement interface Castle.DynamicProxy.IInvocation")]
-		#endif
 		public void GenericMethod_WithConstraintOnOtherParameter ()
 		{
 			var type = typeof(IInterfaceWithGenericMethodWithDependentConstraint);
@@ -57,9 +54,6 @@ namespace Castle.DynamicProxy.Tests
 		}
 
 		[Test]
-#if __MonoCS__
-		[Ignore ("System.Type[] doesn't implement interface Castle.DynamicProxy.IInvocation")]
-		#endif
 		public void GenericMethod_WithConstraintOnSurroundingTypeParameter ()
 		{
 			var type = typeof(IGenericInterfaceWithGenericMethodWithDependentConstraint<object>);
diff --git a/src/Castle.Core.Tests/InterceptorSelectorTestCase.cs b/src/Castle.Core.Tests/InterceptorSelectorTestCase.cs
index 92703a6..c891877 100644
--- a/src/Castle.Core.Tests/InterceptorSelectorTestCase.cs
+++ b/src/Castle.Core.Tests/InterceptorSelectorTestCase.cs
@@ -1,538 +1,535 @@
-// Copyright 2004-2014 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.
-
-namespace Castle.DynamicProxy.Tests
-{
-	using System;
-	using System.Collections.Generic;
-	using System.Reflection;
-#if FEATURE_SERIALIZATION
-	using System.Xml.Serialization;
-#endif
-
-	using Castle.DynamicProxy.Generators;
-	using Castle.DynamicProxy.Internal;
-	using Castle.DynamicProxy.Tests.Classes;
-	using Castle.DynamicProxy.Tests.InterClasses;
-	using Castle.DynamicProxy.Tests.Interceptors;
-	using Castle.DynamicProxy.Tests.Interfaces;
-	using Castle.InterClasses;
-
-	using CastleTests;
-	using CastleTests.DynamicProxy.Tests.Classes;
-
-	using NUnit.Framework;
-
-	[TestFixture]
-	public class InterceptorSelectorTestCase : BasePEVerifyTestCase
-	{
-		[Test]
-		public void BasicCase()
-		{
-			var options = new ProxyGenerationOptions();
-			options.Selector = new AllInterceptorSelector();
-			var target = generator.CreateInterfaceProxyWithTarget(typeof(ISimpleInterface), new SimpleClass(), options, new StandardInterceptor()) as ISimpleInterface;
-			Assert.IsNotNull(target);
-			target.Do();
-		}
-
-		[Test]
-#if __MonoCS__
-		[Ignore("System.Type[] doesn't implement interface Castle.DynamicProxy.IInvocation")]
-#endif
-		public void SelectorWorksForGenericMethods()
-		{
-			var options = new ProxyGenerationOptions();
-			var countingInterceptor = new CallCountingInterceptor();
-			options.Selector = new TypeInterceptorSelector<CallCountingInterceptor>();
-			var target = generator.CreateInterfaceProxyWithTarget(typeof(IGenericInterface), new GenericClass(), options,
-			                                                      new AddTwoInterceptor(),
-			                                                      countingInterceptor) as IGenericInterface;
-			Assert.IsNotNull(target);
-			var result = target.GenericMethod<int>();
-			Assert.AreEqual(1, countingInterceptor.Count);
-			Assert.AreEqual(0, result);
-			var result2 = target.GenericMethod<string>();
-			Assert.AreEqual(2, countingInterceptor.Count);
-			Assert.AreEqual(default(string), result2);
-		}
-
-		[Test]
-		public void SelectorWorksForMethods()
-		{
-			var options = new ProxyGenerationOptions();
-			var countingInterceptor = new CallCountingInterceptor();
-			options.Selector = new TypeInterceptorSelector<CallCountingInterceptor>();
-			var target = generator.CreateInterfaceProxyWithTarget(typeof(ISimpleInterface), new SimpleClass(), options,
-			                                                      new AddTwoInterceptor(), countingInterceptor) as ISimpleInterface;
-			Assert.IsNotNull(target);
-			var result = target.Do();
-			Assert.AreEqual(3, result);
-			Assert.AreEqual(1, countingInterceptor.Count);
-		}
-
-		[Test]
-		public void SelectorWorksForMixins()
-		{
-			var options = new ProxyGenerationOptions();
-			options.AddMixinInstance(new SimpleClass());
-			var countingInterceptor = new CallCountingInterceptor();
-			options.Selector = new TypeInterceptorSelector<CallCountingInterceptor>();
-			var target = generator.CreateInterfaceProxyWithTarget(typeof(ISimpleInterfaceWithProperty),
-			                                                      new SimpleClassWithProperty(), options,
-			                                                      new AddTwoInterceptor(),
-			                                                      countingInterceptor) as ISimpleInterface;
-			Assert.IsNotNull(target);
-			var result = target.Do();
-			Assert.AreEqual(3, result);
-			Assert.AreEqual(1, countingInterceptor.Count);
-		}
-
-		[Test]
-		public void SelectorWorksForMultipleGenericMethods()
-		{
-			var options = new ProxyGenerationOptions();
-			var countingInterceptor = new CallCountingInterceptor();
-			options.Selector = new TypeInterceptorSelector<CallCountingInterceptor>();
-			var target = generator.CreateInterfaceProxyWithTarget(typeof(IMultiGenericInterface), new MultiGenericClass(),
-			                                                      options,
-			                                                      new AddTwoInterceptor(),
-			                                                      countingInterceptor) as IMultiGenericInterface;
-			Assert.IsNotNull(target);
-			var result = target.Method<int, string>("ignored");
-			Assert.AreEqual(1, countingInterceptor.Count);
-			Assert.AreEqual(0, result);
-			var result2 = target.Method<string, int>(0);
-			Assert.AreEqual(2, countingInterceptor.Count);
-			Assert.AreEqual(default(string), result2);
-		}
-
-		[Test]
-		public void SelectorWorksForProperties()
-		{
-			var options = new ProxyGenerationOptions();
-			var countingInterceptor = new CallCountingInterceptor();
-			options.Selector = new TypeInterceptorSelector<CallCountingInterceptor>();
-			var target = generator.CreateInterfaceProxyWithTarget(typeof(ISimpleInterfaceWithProperty),
-			                                                      new SimpleClassWithProperty(), options,
-			                                                      new AddTwoInterceptor(),
-			                                                      countingInterceptor) as ISimpleInterfaceWithProperty;
-			Assert.IsNotNull(target);
-			var result = target.Age;
-			Assert.AreEqual(5, result);
-			Assert.AreEqual(1, countingInterceptor.Count);
-		}
-
-		[Test]
-		public void When_two_selectors_present_and_not_equal_should_cache_type_anyway_InterfaceProxyWithTargetInterface()
-		{
-			var options1 = new ProxyGenerationOptions { Selector = new AllInterceptorSelector() };
-			var options2 = new ProxyGenerationOptions
-			{
-				Selector = new TypeInterceptorSelector<CallCountingInterceptor>()
-			};
-
-			var proxy1 = generator.CreateInterfaceProxyWithTargetInterface<IOne>(new One(), options1);
-			var proxy2 = generator.CreateInterfaceProxyWithTargetInterface<IOne>(new One(), options2);
-			proxy1.OneMethod();
-			proxy2.OneMethod();
-
-			Assert.AreSame(proxy1.GetType(), proxy2.GetType());
-		}
-
-		[Test]
-		public void When_two_selectors_present_and_not_equal_should_cache_type_anyway_InterfaceProxyWithTarget()
-		{
-			var options1 = new ProxyGenerationOptions { Selector = new AllInterceptorSelector() };
-			var options2 = new ProxyGenerationOptions
-			{
-				Selector = new TypeInterceptorSelector<CallCountingInterceptor>()
-			};
-
-			var proxy1 = generator.CreateInterfaceProxyWithTarget<IOne>(new One(), options1);
-			var proxy2 = generator.CreateInterfaceProxyWithTarget<IOne>(new One(), options2);
-			proxy1.OneMethod();
-			proxy2.OneMethod();
-
-			Assert.AreSame(proxy1.GetType(), proxy2.GetType());
-		}
-
-		[Test]
-		public void When_two_selectors_present_and_not_equal_should_cache_type_anyway_InterfaceProxyWithoutTarget()
-		{
-			var options1 = new ProxyGenerationOptions { Selector = new AllInterceptorSelector() };
-			var options2 = new ProxyGenerationOptions
-			{
-				Selector = new TypeInterceptorSelector<SetReturnValueInterceptor>()
-			};
-
-			var proxy1 = generator.CreateInterfaceProxyWithoutTarget(typeof(IOne), Type.EmptyTypes, options1, new SetReturnValueInterceptor(2));
-			var proxy2 = generator.CreateInterfaceProxyWithoutTarget(typeof(IOne), Type.EmptyTypes, options2, new SetReturnValueInterceptor(2));
-			(proxy1 as IOne).OneMethod();
-			(proxy2 as IOne).OneMethod();
-
-			Assert.AreSame(proxy1.GetType(), proxy2.GetType());
-		}
-
-		[Test]
-		public void When_two_selectors_present_and_not_equal_should_cache_type_anyway_ClassProxy()
-		{
-			var options1 = new ProxyGenerationOptions { Selector = new AllInterceptorSelector() };
-			var options2 = new ProxyGenerationOptions
-			{
-				Selector = new TypeInterceptorSelector<CallCountingInterceptor>()
-			};
-
-			var proxy1 = generator.CreateClassProxy(typeof(ServiceClass), Type.EmptyTypes, options1);
-			var proxy2 = generator.CreateClassProxy(typeof(ServiceClass), Type.EmptyTypes, options2);
-			(proxy1 as ServiceClass).Sum(2, 2);
-			(proxy2 as ServiceClass).Sum(2, 2);
-
-			Assert.AreSame(proxy1.GetType(), proxy2.GetType());
-		}
-
-		[Test]
-		[Bug("DYNPROXY-175")]
-		public void Can_proxy_same_type_with_and_without_selector_InterfaceProxyWithoutTarget()
-		{
-			var someInstanceOfProxyWithoutSelector = (IService2)generator.CreateInterfaceProxyWithoutTarget(typeof(IService2), new DoNothingInterceptor());
-			var someInstanceOfProxyWithSelector = (IService2)generator.CreateInterfaceProxyWithoutTarget(typeof(IService2), new ProxyGenerationOptions
-			{
-				Selector = new AllInterceptorSelector()
-			}, new DoNothingInterceptor());
-
-			// This runs fine
-			someInstanceOfProxyWithoutSelector.DoOperation2();
-			// This will throw System.InvalidProgramException
-			someInstanceOfProxyWithSelector.DoOperation2();
-		}
-
-		[Test]
-		[Bug("DYNPROXY-175")]
-		public void Can_proxy_same_type_with_and_without_selector_InterfaceProxyWithTarget()
-		{
-			var someInstanceOfProxyWithoutSelector = (IService2)generator.CreateInterfaceProxyWithTarget(typeof(IService2), new Service2(), new StandardInterceptor());
-			var someInstanceOfProxyWithSelector = (IService2)generator.CreateInterfaceProxyWithTarget(typeof(IService2), new Service2(),
-			                                                                                          new ProxyGenerationOptions { Selector = new AllInterceptorSelector() },
-			                                                                                          new StandardInterceptor());
-
-			// This runs fine
-			someInstanceOfProxyWithoutSelector.DoOperation2();
-			// This will throw System.InvalidProgramException
-			someInstanceOfProxyWithSelector.DoOperation2();
-		}
-
-		[Test]
-		[Bug("DYNPROXY-175")]
-		public void Can_proxy_same_type_with_and_without_selector_InterfaceProxyWithTargetInterface()
-		{
-			var someInstanceOfProxyWithoutSelector = (IService2)generator.CreateInterfaceProxyWithTargetInterface(typeof(IService2), new Service2(), new StandardInterceptor());
-			var someInstanceOfProxyWithSelector = (IService2)generator.CreateInterfaceProxyWithTargetInterface(typeof(IService2), new Service2(),
-			                                                                                                   new ProxyGenerationOptions { Selector = new AllInterceptorSelector() },
-			                                                                                                   new StandardInterceptor());
-
-			// This runs fine
-			someInstanceOfProxyWithoutSelector.DoOperation2();
-			// This will throw System.InvalidProgramException
-			someInstanceOfProxyWithSelector.DoOperation2();
-		}
-
-		[Test]
-		[Bug("DYNPROXY-175")]
-		public void Can_proxy_same_type_with_and_without_selector_ClassProxy()
-		{
-			var someInstanceOfProxyWithoutSelector = (Component2)generator.CreateClassProxy(typeof(Component2), new StandardInterceptor());
-			var someInstanceOfProxyWithSelector = (Component2)generator.CreateClassProxy(typeof(Component2),
-			                                                                             new ProxyGenerationOptions { Selector = new AllInterceptorSelector() },
-			                                                                             new StandardInterceptor());
-
-			// This runs fine
-			someInstanceOfProxyWithoutSelector.DoOperation2();
-			// This will throw System.InvalidProgramException
-			someInstanceOfProxyWithSelector.DoOperation2();
-		}
-
-		[Test]
-		[Bug("DYNPROXY-175")]
-		public void Can_proxy_same_type_with_and_without_selector_ClassProxyWithTarget()
-		{
-			var someInstanceOfProxyWithoutSelector = (Component2)generator.CreateClassProxyWithTarget(typeof(Component2), new Component2(), new StandardInterceptor());
-			var someInstanceOfProxyWithSelector = (Component2)generator.CreateClassProxyWithTarget(typeof(Component2), new Component2(),
-			                                                                                       new ProxyGenerationOptions { Selector = new AllInterceptorSelector() },
-			                                                                                       new StandardInterceptor());
-
-			// This runs fine
-			someInstanceOfProxyWithoutSelector.DoOperation2();
-			// This will throw System.InvalidProgramException
-			someInstanceOfProxyWithSelector.DoOperation2();
-		}
-
-		[Test]
-		[Bug("DYNPROXY-175")]
-		public void Can_proxy_same_type_with_and_without_selector_InterfaceProxyWithTarget2()
-		{
-			var someInstanceOfProxyWithSelector1 = (IService2)generator.CreateInterfaceProxyWithTarget(typeof(IService2), new Service2(),
-			                                                                                           new ProxyGenerationOptions { Selector = new SelectorWithState(1) },
-			                                                                                           new StandardInterceptor());
-			var someInstanceOfProxyWithSelector2 = (IService2)generator.CreateInterfaceProxyWithTarget(typeof(IService2), new Service2(),
-			                                                                                           new ProxyGenerationOptions { Selector = new SelectorWithState(2) },
-			                                                                                           new StandardInterceptor());
-
-			Assert.AreSame(someInstanceOfProxyWithSelector1.GetType(), someInstanceOfProxyWithSelector2.GetType());
-		}
-
-		[Test]
-		public void Cannot_proxy_inaccessible_interface()
-		{
-			var exception = Assert.Throws<GeneratorException>(() => generator.CreateInterfaceProxyWithTarget<PrivateInterface>(new PrivateClass(), new IInterceptor[0]));
-			Assert.That(exception.Message, Is.StringStarting("Can not create proxy for type Castle.DynamicProxy.Tests.InterceptorSelectorTestCase+PrivateInterface because it is not accessible. Make it public, or internal"));
-		}
-
-		[Test]
-		public void Cannot_proxy_generic_interface_with_inaccessible_type_argument()
-		{
-			var exception = Assert.Throws<GeneratorException>(() => generator.CreateInterfaceProxyWithTarget<IList<PrivateInterface>>(new List<PrivateInterface>(), new IInterceptor[0]));
-			Assert.That(exception.Message, Is.StringStarting("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"));
-		}
-
-		[Test]
-		public void Cannot_proxy_generic_interface_with_type_argument_that_has_inaccessible_type_argument()
-		{
-			var exception = Assert.Throws<GeneratorException>(() => generator.CreateInterfaceProxyWithTarget<IList<IList<PrivateInterface>>>(new List<IList<PrivateInterface>>(), new IInterceptor[0]));
-		}
-
-		[Test]
-		public void Can_proxy_generic_interface()
-		{
-			generator.CreateInterfaceProxyWithTarget<IList<object>>(new List<object>(), new IInterceptor[0]);
-		}
-
-		private interface PrivateInterface { }
-
-		private class PrivateClass : PrivateInterface { }
-	}
-
-	public class MultiGenericClass : IMultiGenericInterface
-	{
-		public T1 Method<T1, T2>(T2 p)
-		{
-			return default(T1);
-		}
-
-		public T2 Method<T1, T2>(T1 p)
-		{
-			return default(T2);
-		}
-	}
-
-	public interface IMultiGenericInterface
-	{
-		T1 Method<T1, T2>(T2 p);
-
-		T2 Method<T1, T2>(T1 p);
-	}
-
-#if FEATURE_SERIALIZATION
-	[Serializable]
-#endif
-	public class GenericClass : IGenericInterface
-	{
-		#region IGenericInterface Members
-
-		public T GenericMethod<T>()
-		{
-			return default(T);
-		}
-
-		#endregion
-	}
-
-	public interface IGenericInterface
-	{
-		T GenericMethod<T>();
-	}
-
-	public interface ISimpleInterfaceWithProperty
-	{
-		int Age { get; }
-	}
-
-	public class SimpleClassWithProperty : ISimpleInterfaceWithProperty
-	{
-		public int Age
-		{
-			get { return 5; }
-		}
-	}
-
-#if FEATURE_SERIALIZATION
-	[Serializable]
-#endif
-	internal class TypeInterceptorSelector<TInterceptor> : IInterceptorSelector where TInterceptor : IInterceptor
-	{
-		#region IInterceptorSelector Members
-
-		public IInterceptor[] SelectInterceptors(Type type, MethodInfo method, IInterceptor[] interceptors)
-		{
-			var interceptorsOfT = new List<IInterceptor>();
-			foreach (var interceptor in interceptors)
-			{
-				if (interceptor is TInterceptor)
-				{
-					interceptorsOfT.Add(interceptor);
-				}
-			}
-			return interceptorsOfT.ToArray();
-		}
-
-		#endregion
-	}
-
-#if FEATURE_SERIALIZATION
-	[Serializable]
-#endif
-	public class AllInterceptorSelector : IInterceptorSelector
-	{
-		#region IInterceptorSelector Members
-
-		public IInterceptor[] SelectInterceptors(Type type, MethodInfo method, IInterceptor[] interceptors)
-		{
-			return interceptors;
-		}
-
-		#endregion
-	}
-
-#if FEATURE_SERIALIZATION
-	[Serializable]
-#endif
-	public class SelectorWithState : IInterceptorSelector
-	{
-		private readonly int state;
-
-		public SelectorWithState(int state)
-		{
-			this.state = state;
-		}
-
-		public override bool Equals(object obj)
-		{
-			if (ReferenceEquals(null, obj))
-			{
-				return false;
-			}
-			if (ReferenceEquals(this, obj))
-			{
-				return true;
-			}
-			if (obj.GetType() != GetType())
-			{
-				return false;
-			}
-			return Equals((SelectorWithState)obj);
-		}
-
-		public override int GetHashCode()
-		{
-			return state;
-		}
-
-		public IInterceptor[] SelectInterceptors(Type type, MethodInfo method, IInterceptor[] interceptors)
-		{
-			return interceptors;
-		}
-
-		protected bool Equals(SelectorWithState other)
-		{
-			return state == other.state;
-		}
-	}
-
-#if FEATURE_SERIALIZATION
-	[Serializable]
-#endif
-	public class SimpleClass : ISimpleInterface
-	{
-		#region ISimpleInterface Members
-
-		public int Do()
-		{
-			return 3;
-		}
-
-		#endregion
-	}
-
-	public interface ISimpleInterface
-	{
-		int Do();
-	}
-
-	public class FakeProxy
-	{
-		// Fields
-		public static ProxyGenerationOptions proxyGenerationOptions;
-		public static MethodInfo token_Do;
-
-#if FEATURE_SERIALIZATION
-		[XmlIgnore]
-#endif
-		public IInterceptor[] __interceptors;
-
-		public IInterceptorSelector __selector;
-
-#if FEATURE_SERIALIZATION
-		[XmlIgnore]
-#endif
-		public SimpleClass __target;
-
-#if FEATURE_SERIALIZATION
-		[NonSerialized]
-		[XmlIgnore]
-#endif
-		public IInterceptor[] interceptors_Do;
-
-		public virtual int Do()
-		{
-			// This item is obfuscated and can not be translated.
-			if (interceptors_Do == null)
-			{
-				interceptors_Do = __selector.SelectInterceptors(TypeUtil.GetTypeOrNull(__target), token_Do, __interceptors) ?? new IInterceptor[0];
-			}
-			var objArray = new object[0];
-			var @do = new ISimpleInterface_Do(__target, this, interceptors_Do, token_Do, objArray);
-			@do.Proceed();
-			return (int)@do.ReturnValue;
-		}
-	}
-
-	public class ISimpleInterface_Do
-	{
-		public ISimpleInterface_Do(SimpleClass simpleClass, FakeProxy fakeProxy, IInterceptor[] interceptorsDo, MethodInfo tokenDo, object[] objArray)
-		{
-			throw new NotImplementedException();
-		}
-
-		public object ReturnValue
-		{
-			get { throw new NotImplementedException(); }
-			set { throw new NotImplementedException(); }
-		}
-
-		public void Proceed()
-		{
-			throw new NotImplementedException();
-		}
-	}
+// Copyright 2004-2014 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.
+
+namespace Castle.DynamicProxy.Tests
+{
+	using System;
+	using System.Collections.Generic;
+	using System.Reflection;
+#if FEATURE_SERIALIZATION
+	using System.Xml.Serialization;
+#endif
+
+	using Castle.DynamicProxy.Generators;
+	using Castle.DynamicProxy.Internal;
+	using Castle.DynamicProxy.Tests.Classes;
+	using Castle.DynamicProxy.Tests.InterClasses;
+	using Castle.DynamicProxy.Tests.Interceptors;
+	using Castle.DynamicProxy.Tests.Interfaces;
+	using Castle.InterClasses;
+
+	using CastleTests;
+	using CastleTests.DynamicProxy.Tests.Classes;
+
+	using NUnit.Framework;
+
+	[TestFixture]
+	public class InterceptorSelectorTestCase : BasePEVerifyTestCase
+	{
+		[Test]
+		public void BasicCase()
+		{
+			var options = new ProxyGenerationOptions();
+			options.Selector = new AllInterceptorSelector();
+			var target = generator.CreateInterfaceProxyWithTarget(typeof(ISimpleInterface), new SimpleClass(), options, new StandardInterceptor()) as ISimpleInterface;
+			Assert.IsNotNull(target);
+			target.Do();
+		}
+
+		[Test]
+		public void SelectorWorksForGenericMethods()
+		{
+			var options = new ProxyGenerationOptions();
+			var countingInterceptor = new CallCountingInterceptor();
+			options.Selector = new TypeInterceptorSelector<CallCountingInterceptor>();
+			var target = generator.CreateInterfaceProxyWithTarget(typeof(IGenericInterface), new GenericClass(), options,
+			                                                      new AddTwoInterceptor(),
+			                                                      countingInterceptor) as IGenericInterface;
+			Assert.IsNotNull(target);
+			var result = target.GenericMethod<int>();
+			Assert.AreEqual(1, countingInterceptor.Count);
+			Assert.AreEqual(0, result);
+			var result2 = target.GenericMethod<string>();
+			Assert.AreEqual(2, countingInterceptor.Count);
+			Assert.AreEqual(default(string), result2);
+		}
+
+		[Test]
+		public void SelectorWorksForMethods()
+		{
+			var options = new ProxyGenerationOptions();
+			var countingInterceptor = new CallCountingInterceptor();
+			options.Selector = new TypeInterceptorSelector<CallCountingInterceptor>();
+			var target = generator.CreateInterfaceProxyWithTarget(typeof(ISimpleInterface), new SimpleClass(), options,
+			                                                      new AddTwoInterceptor(), countingInterceptor) as ISimpleInterface;
+			Assert.IsNotNull(target);
+			var result = target.Do();
+			Assert.AreEqual(3, result);
+			Assert.AreEqual(1, countingInterceptor.Count);
+		}
+
+		[Test]
+		public void SelectorWorksForMixins()
+		{
+			var options = new ProxyGenerationOptions();
+			options.AddMixinInstance(new SimpleClass());
+			var countingInterceptor = new CallCountingInterceptor();
+			options.Selector = new TypeInterceptorSelector<CallCountingInterceptor>();
+			var target = generator.CreateInterfaceProxyWithTarget(typeof(ISimpleInterfaceWithProperty),
+			                                                      new SimpleClassWithProperty(), options,
+			                                                      new AddTwoInterceptor(),
+			                                                      countingInterceptor) as ISimpleInterface;
+			Assert.IsNotNull(target);
+			var result = target.Do();
+			Assert.AreEqual(3, result);
+			Assert.AreEqual(1, countingInterceptor.Count);
+		}
+
+		[Test]
+		public void SelectorWorksForMultipleGenericMethods()
+		{
+			var options = new ProxyGenerationOptions();
+			var countingInterceptor = new CallCountingInterceptor();
+			options.Selector = new TypeInterceptorSelector<CallCountingInterceptor>();
+			var target = generator.CreateInterfaceProxyWithTarget(typeof(IMultiGenericInterface), new MultiGenericClass(),
+			                                                      options,
+			                                                      new AddTwoInterceptor(),
+			                                                      countingInterceptor) as IMultiGenericInterface;
+			Assert.IsNotNull(target);
+			var result = target.Method<int, string>("ignored");
+			Assert.AreEqual(1, countingInterceptor.Count);
+			Assert.AreEqual(0, result);
+			var result2 = target.Method<string, int>(0);
+			Assert.AreEqual(2, countingInterceptor.Count);
+			Assert.AreEqual(default(string), result2);
+		}
+
+		[Test]
+		public void SelectorWorksForProperties()
+		{
+			var options = new ProxyGenerationOptions();
+			var countingInterceptor = new CallCountingInterceptor();
+			options.Selector = new TypeInterceptorSelector<CallCountingInterceptor>();
+			var target = generator.CreateInterfaceProxyWithTarget(typeof(ISimpleInterfaceWithProperty),
+			                                                      new SimpleClassWithProperty(), options,
+			                                                      new AddTwoInterceptor(),
+			                                                      countingInterceptor) as ISimpleInterfaceWithProperty;
+			Assert.IsNotNull(target);
+			var result = target.Age;
+			Assert.AreEqual(5, result);
+			Assert.AreEqual(1, countingInterceptor.Count);
+		}
+
+		[Test]
+		public void When_two_selectors_present_and_not_equal_should_cache_type_anyway_InterfaceProxyWithTargetInterface()
+		{
+			var options1 = new ProxyGenerationOptions { Selector = new AllInterceptorSelector() };
+			var options2 = new ProxyGenerationOptions
+			{
+				Selector = new TypeInterceptorSelector<CallCountingInterceptor>()
+			};
+
+			var proxy1 = generator.CreateInterfaceProxyWithTargetInterface<IOne>(new One(), options1);
+			var proxy2 = generator.CreateInterfaceProxyWithTargetInterface<IOne>(new One(), options2);
+			proxy1.OneMethod();
+			proxy2.OneMethod();
+
+			Assert.AreSame(proxy1.GetType(), proxy2.GetType());
+		}
+
+		[Test]
+		public void When_two_selectors_present_and_not_equal_should_cache_type_anyway_InterfaceProxyWithTarget()
+		{
+			var options1 = new ProxyGenerationOptions { Selector = new AllInterceptorSelector() };
+			var options2 = new ProxyGenerationOptions
+			{
+				Selector = new TypeInterceptorSelector<CallCountingInterceptor>()
+			};
+
+			var proxy1 = generator.CreateInterfaceProxyWithTarget<IOne>(new One(), options1);
+			var proxy2 = generator.CreateInterfaceProxyWithTarget<IOne>(new One(), options2);
+			proxy1.OneMethod();
+			proxy2.OneMethod();
+
+			Assert.AreSame(proxy1.GetType(), proxy2.GetType());
+		}
+
+		[Test]
+		public void When_two_selectors_present_and_not_equal_should_cache_type_anyway_InterfaceProxyWithoutTarget()
+		{
+			var options1 = new ProxyGenerationOptions { Selector = new AllInterceptorSelector() };
+			var options2 = new ProxyGenerationOptions
+			{
+				Selector = new TypeInterceptorSelector<SetReturnValueInterceptor>()
+			};
+
+			var proxy1 = generator.CreateInterfaceProxyWithoutTarget(typeof(IOne), Type.EmptyTypes, options1, new SetReturnValueInterceptor(2));
+			var proxy2 = generator.CreateInterfaceProxyWithoutTarget(typeof(IOne), Type.EmptyTypes, options2, new SetReturnValueInterceptor(2));
+			(proxy1 as IOne).OneMethod();
+			(proxy2 as IOne).OneMethod();
+
+			Assert.AreSame(proxy1.GetType(), proxy2.GetType());
+		}
+
+		[Test]
+		public void When_two_selectors_present_and_not_equal_should_cache_type_anyway_ClassProxy()
+		{
+			var options1 = new ProxyGenerationOptions { Selector = new AllInterceptorSelector() };
+			var options2 = new ProxyGenerationOptions
+			{
+				Selector = new TypeInterceptorSelector<CallCountingInterceptor>()
+			};
+
+			var proxy1 = generator.CreateClassProxy(typeof(ServiceClass), Type.EmptyTypes, options1);
+			var proxy2 = generator.CreateClassProxy(typeof(ServiceClass), Type.EmptyTypes, options2);
+			(proxy1 as ServiceClass).Sum(2, 2);
+			(proxy2 as ServiceClass).Sum(2, 2);
+
+			Assert.AreSame(proxy1.GetType(), proxy2.GetType());
+		}
+
+		[Test]
+		[Bug("DYNPROXY-175")]
+		public void Can_proxy_same_type_with_and_without_selector_InterfaceProxyWithoutTarget()
+		{
+			var someInstanceOfProxyWithoutSelector = (IService2)generator.CreateInterfaceProxyWithoutTarget(typeof(IService2), new DoNothingInterceptor());
+			var someInstanceOfProxyWithSelector = (IService2)generator.CreateInterfaceProxyWithoutTarget(typeof(IService2), new ProxyGenerationOptions
+			{
+				Selector = new AllInterceptorSelector()
+			}, new DoNothingInterceptor());
+
+			// This runs fine
+			someInstanceOfProxyWithoutSelector.DoOperation2();
+			// This will throw System.InvalidProgramException
+			someInstanceOfProxyWithSelector.DoOperation2();
+		}
+
+		[Test]
+		[Bug("DYNPROXY-175")]
+		public void Can_proxy_same_type_with_and_without_selector_InterfaceProxyWithTarget()
+		{
+			var someInstanceOfProxyWithoutSelector = (IService2)generator.CreateInterfaceProxyWithTarget(typeof(IService2), new Service2(), new StandardInterceptor());
+			var someInstanceOfProxyWithSelector = (IService2)generator.CreateInterfaceProxyWithTarget(typeof(IService2), new Service2(),
+			                                                                                          new ProxyGenerationOptions { Selector = new AllInterceptorSelector() },
+			                                                                                          new StandardInterceptor());
+
+			// This runs fine
+			someInstanceOfProxyWithoutSelector.DoOperation2();
+			// This will throw System.InvalidProgramException
+			someInstanceOfProxyWithSelector.DoOperation2();
+		}
+
+		[Test]
+		[Bug("DYNPROXY-175")]
+		public void Can_proxy_same_type_with_and_without_selector_InterfaceProxyWithTargetInterface()
+		{
+			var someInstanceOfProxyWithoutSelector = (IService2)generator.CreateInterfaceProxyWithTargetInterface(typeof(IService2), new Service2(), new StandardInterceptor());
+			var someInstanceOfProxyWithSelector = (IService2)generator.CreateInterfaceProxyWithTargetInterface(typeof(IService2), new Service2(),
+			                                                                                                   new ProxyGenerationOptions { Selector = new AllInterceptorSelector() },
+			                                                                                                   new StandardInterceptor());
+
+			// This runs fine
+			someInstanceOfProxyWithoutSelector.DoOperation2();
+			// This will throw System.InvalidProgramException
+			someInstanceOfProxyWithSelector.DoOperation2();
+		}
+
+		[Test]
+		[Bug("DYNPROXY-175")]
+		public void Can_proxy_same_type_with_and_without_selector_ClassProxy()
+		{
+			var someInstanceOfProxyWithoutSelector = (Component2)generator.CreateClassProxy(typeof(Component2), new StandardInterceptor());
+			var someInstanceOfProxyWithSelector = (Component2)generator.CreateClassProxy(typeof(Component2),
+			                                                                             new ProxyGenerationOptions { Selector = new AllInterceptorSelector() },
+			                                                                             new StandardInterceptor());
+
+			// This runs fine
+			someInstanceOfProxyWithoutSelector.DoOperation2();
+			// This will throw System.InvalidProgramException
+			someInstanceOfProxyWithSelector.DoOperation2();
+		}
+
+		[Test]
+		[Bug("DYNPROXY-175")]
+		public void Can_proxy_same_type_with_and_without_selector_ClassProxyWithTarget()
+		{
+			var someInstanceOfProxyWithoutSelector = (Component2)generator.CreateClassProxyWithTarget(typeof(Component2), new Component2(), new StandardInterceptor());
+			var someInstanceOfProxyWithSelector = (Component2)generator.CreateClassProxyWithTarget(typeof(Component2), new Component2(),
+			                                                                                       new ProxyGenerationOptions { Selector = new AllInterceptorSelector() },
+			                                                                                       new StandardInterceptor());
+
+			// This runs fine
+			someInstanceOfProxyWithoutSelector.DoOperation2();
+			// This will throw System.InvalidProgramException
+			someInstanceOfProxyWithSelector.DoOperation2();
+		}
+
+		[Test]
+		[Bug("DYNPROXY-175")]
+		public void Can_proxy_same_type_with_and_without_selector_InterfaceProxyWithTarget2()
+		{
+			var someInstanceOfProxyWithSelector1 = (IService2)generator.CreateInterfaceProxyWithTarget(typeof(IService2), new Service2(),
+			                                                                                           new ProxyGenerationOptions { Selector = new SelectorWithState(1) },
+			                                                                                           new StandardInterceptor());
+			var someInstanceOfProxyWithSelector2 = (IService2)generator.CreateInterfaceProxyWithTarget(typeof(IService2), new Service2(),
+			                                                                                           new ProxyGenerationOptions { Selector = new SelectorWithState(2) },
+			                                                                                           new StandardInterceptor());
+
+			Assert.AreSame(someInstanceOfProxyWithSelector1.GetType(), someInstanceOfProxyWithSelector2.GetType());
+		}
+
+		[Test]
+		public void Cannot_proxy_inaccessible_interface()
+		{
+			var exception = Assert.Throws<GeneratorException>(() => generator.CreateInterfaceProxyWithTarget<PrivateInterface>(new PrivateClass(), new IInterceptor[0]));
+			Assert.That(exception.Message, Is.StringStarting("Can not create proxy for type Castle.DynamicProxy.Tests.InterceptorSelectorTestCase+PrivateInterface because it is not accessible. Make it public, or internal"));
+		}
+
+		[Test]
+		public void Cannot_proxy_generic_interface_with_inaccessible_type_argument()
+		{
+			var exception = Assert.Throws<GeneratorException>(() => generator.CreateInterfaceProxyWithTarget<IList<PrivateInterface>>(new List<PrivateInterface>(), new IInterceptor[0]));
+			Assert.That(exception.Message, Is.StringStarting("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"));
+		}
+
+		[Test]
+		public void Cannot_proxy_generic_interface_with_type_argument_that_has_inaccessible_type_argument()
+		{
+			var exception = Assert.Throws<GeneratorException>(() => generator.CreateInterfaceProxyWithTarget<IList<IList<PrivateInterface>>>(new List<IList<PrivateInterface>>(), new IInterceptor[0]));
+		}
+
+		[Test]
+		public void Can_proxy_generic_interface()
+		{
+			generator.CreateInterfaceProxyWithTarget<IList<object>>(new List<object>(), new IInterceptor[0]);
+		}
+
+		private interface PrivateInterface { }
+
+		private class PrivateClass : PrivateInterface { }
+	}
+
+	public class MultiGenericClass : IMultiGenericInterface
+	{
+		public T1 Method<T1, T2>(T2 p)
+		{
+			return default(T1);
+		}
+
+		public T2 Method<T1, T2>(T1 p)
+		{
+			return default(T2);
+		}
+	}
+
+	public interface IMultiGenericInterface
+	{
+		T1 Method<T1, T2>(T2 p);
+
+		T2 Method<T1, T2>(T1 p);
+	}
+
+#if FEATURE_SERIALIZATION
+	[Serializable]
+#endif
+	public class GenericClass : IGenericInterface
+	{
+		#region IGenericInterface Members
+
+		public T GenericMethod<T>()
+		{
+			return default(T);
+		}
+
+		#endregion
+	}
+
+	public interface IGenericInterface
+	{
+		T GenericMethod<T>();
+	}
+
+	public interface ISimpleInterfaceWithProperty
+	{
+		int Age { get; }
+	}
+
+	public class SimpleClassWithProperty : ISimpleInterfaceWithProperty
+	{
+		public int Age
+		{
+			get { return 5; }
+		}
+	}
+
+#if FEATURE_SERIALIZATION
+	[Serializable]
+#endif
+	internal class TypeInterceptorSelector<TInterceptor> : IInterceptorSelector where TInterceptor : IInterceptor
+	{
+		#region IInterceptorSelector Members
+
+		public IInterceptor[] SelectInterceptors(Type type, MethodInfo method, IInterceptor[] interceptors)
+		{
+			var interceptorsOfT = new List<IInterceptor>();
+			foreach (var interceptor in interceptors)
+			{
+				if (interceptor is TInterceptor)
+				{
+					interceptorsOfT.Add(interceptor);
+				}
+			}
+			return interceptorsOfT.ToArray();
+		}
+
+		#endregion
+	}
+
+#if FEATURE_SERIALIZATION
+	[Serializable]
+#endif
+	public class AllInterceptorSelector : IInterceptorSelector
+	{
+		#region IInterceptorSelector Members
+
+		public IInterceptor[] SelectInterceptors(Type type, MethodInfo method, IInterceptor[] interceptors)
+		{
+			return interceptors;
+		}
+
+		#endregion
+	}
+
+#if FEATURE_SERIALIZATION
+	[Serializable]
+#endif
+	public class SelectorWithState : IInterceptorSelector
+	{
+		private readonly int state;
+
+		public SelectorWithState(int state)
+		{
+			this.state = state;
+		}
+
+		public override bool Equals(object obj)
+		{
+			if (ReferenceEquals(null, obj))
+			{
+				return false;
+			}
+			if (ReferenceEquals(this, obj))
+			{
+				return true;
+			}
+			if (obj.GetType() != GetType())
+			{
+				return false;
+			}
+			return Equals((SelectorWithState)obj);
+		}
+
+		public override int GetHashCode()
+		{
+			return state;
+		}
+
+		public IInterceptor[] SelectInterceptors(Type type, MethodInfo method, IInterceptor[] interceptors)
+		{
+			return interceptors;
+		}
+
+		protected bool Equals(SelectorWithState other)
+		{
+			return state == other.state;
+		}
+	}
+
+#if FEATURE_SERIALIZATION
+	[Serializable]
+#endif
+	public class SimpleClass : ISimpleInterface
+	{
+		#region ISimpleInterface Members
+
+		public int Do()
+		{
+			return 3;
+		}
+
+		#endregion
+	}
+
+	public interface ISimpleInterface
+	{
+		int Do();
+	}
+
+	public class FakeProxy
+	{
+		// Fields
+		public static ProxyGenerationOptions proxyGenerationOptions;
+		public static MethodInfo token_Do;
+
+#if FEATURE_SERIALIZATION
+		[XmlIgnore]
+#endif
+		public IInterceptor[] __interceptors;
+
+		public IInterceptorSelector __selector;
+
+#if FEATURE_SERIALIZATION
+		[XmlIgnore]
+#endif
+		public SimpleClass __target;
+
+#if FEATURE_SERIALIZATION
+		[NonSerialized]
+		[XmlIgnore]
+#endif
+		public IInterceptor[] interceptors_Do;
+
+		public virtual int Do()
+		{
+			// This item is obfuscated and can not be translated.
+			if (interceptors_Do == null)
+			{
+				interceptors_Do = __selector.SelectInterceptors(TypeUtil.GetTypeOrNull(__target), token_Do, __interceptors) ?? new IInterceptor[0];
+			}
+			var objArray = new object[0];
+			var @do = new ISimpleInterface_Do(__target, this, interceptors_Do, token_Do, objArray);
+			@do.Proceed();
+			return (int)@do.ReturnValue;
+		}
+	}
+
+	public class ISimpleInterface_Do
+	{
+		public ISimpleInterface_Do(SimpleClass simpleClass, FakeProxy fakeProxy, IInterceptor[] interceptorsDo, MethodInfo tokenDo, object[] objArray)
+		{
+			throw new NotImplementedException();
+		}
+
+		public object ReturnValue
+		{
+			get { throw new NotImplementedException(); }
+			set { throw new NotImplementedException(); }
+		}
+
+		public void Proceed()
+		{
+			throw new NotImplementedException();
+		}
+	}
 }
\ No newline at end of file
diff --git a/src/Castle.Core.Tests/ModuleScopeTestCase.cs b/src/Castle.Core.Tests/ModuleScopeTestCase.cs
index eec48be..4da9c24 100644
--- a/src/Castle.Core.Tests/ModuleScopeTestCase.cs
+++ b/src/Castle.Core.Tests/ModuleScopeTestCase.cs
@@ -1,506 +1,506 @@
-// Copyright 2004-2010 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.
-
-namespace Castle.DynamicProxy.Tests
-{
-	using System;
-	using System.IO;
-	using System.Reflection;
-	using Castle.DynamicProxy.Generators;
-	using Castle.DynamicProxy.Serialization;
-	using Castle.DynamicProxy.Tests.InterClasses;
-	using NUnit.Framework;
-
-	[TestFixture]
-	public class ModuleScopeTestCase
-	{
-		[Test]
-		public void ModuleScopeStoresModuleBuilder()
-		{
-			var scope = new ModuleScope();
-			var one = scope.ObtainDynamicModuleWithStrongName();
-			var two = scope.ObtainDynamicModuleWithStrongName();
-
-			Assert.AreSame(one, two);
-			Assert.AreSame(one.Assembly, two.Assembly);
-		}
-
-		[Test]
-		public void ModuleScopeCanHandleSignedAndUnsignedInParallel()
-		{
-			var scope = new ModuleScope();
-			Assert.IsNull(scope.StrongNamedModule);
-			Assert.IsNull(scope.WeakNamedModule);
-
-			var one = scope.ObtainDynamicModuleWithStrongName();
-			Assert.IsNotNull(scope.StrongNamedModule);
-			Assert.IsNull(scope.WeakNamedModule);
-			Assert.AreSame(one, scope.StrongNamedModule);
-
-			var two = scope.ObtainDynamicModuleWithWeakName();
-			Assert.IsNotNull(scope.StrongNamedModule);
-			Assert.IsNotNull(scope.WeakNamedModule);
-			Assert.AreSame(two, scope.WeakNamedModule);
-
-			Assert.AreNotSame(one, two);
-			Assert.AreNotSame(one.Assembly, two.Assembly);
-
-			var three = scope.ObtainDynamicModuleWithStrongName();
-			var four = scope.ObtainDynamicModuleWithWeakName();
-
-			Assert.AreSame(one, three);
-			Assert.AreSame(two, four);
-		}
-
-#if !SILVERLIGHT
-
-		[Test]
-#if __MonoCS__
-		[Ignore("Expected: CastleDynProxy2.dll  But was:  /home/teamcity/buildagent/work/...")]
-#endif
-		public void ImplicitModulePaths()
-		{
-			var scope = new ModuleScope(true);
-			Assert.AreEqual(ModuleScope.DEFAULT_FILE_NAME, scope.StrongNamedModuleName);
-			Assert.AreEqual(Path.Combine(Environment.CurrentDirectory, ModuleScope.DEFAULT_FILE_NAME),
-			                scope.ObtainDynamicModuleWithStrongName().FullyQualifiedName);
-			Assert.IsNull(scope.StrongNamedModuleDirectory);
-
-			Assert.AreEqual(ModuleScope.DEFAULT_FILE_NAME, scope.WeakNamedModuleName);
-			Assert.AreEqual(Path.Combine(Environment.CurrentDirectory, ModuleScope.DEFAULT_FILE_NAME),
-			                scope.ObtainDynamicModuleWithWeakName().FullyQualifiedName);
-			Assert.IsNull(scope.WeakNamedModuleDirectory);
-		}
-
-		[Test]
-#if __MonoCS__
-		[Ignore("Expected: StrongModule.dll  But was:  /home/teamcity/buildagent/work/...")]
-#endif
-		public void ExplicitModulePaths()
-		{
-			var scope = new ModuleScope(true, false, "Strong", "StrongModule.dll", "Weak", "WeakModule.dll");
-			Assert.AreEqual("StrongModule.dll", scope.StrongNamedModuleName);
-			Assert.AreEqual(Path.Combine(Environment.CurrentDirectory, "StrongModule.dll"),
-			                scope.ObtainDynamicModuleWithStrongName().FullyQualifiedName);
-			Assert.IsNull(scope.StrongNamedModuleDirectory);
-
-			Assert.AreEqual("WeakModule.dll", scope.WeakNamedModuleName);
-			Assert.AreEqual(Path.Combine(Environment.CurrentDirectory, "WeakModule.dll"),
-			                scope.ObtainDynamicModuleWithWeakName().FullyQualifiedName);
-			Assert.IsNull(scope.WeakNamedModuleDirectory);
-
-			scope = new ModuleScope(true, false, "Strong", @"c:\Foo\StrongModule.dll", "Weak", @"d:\Bar\WeakModule.dll");
-			Assert.AreEqual("StrongModule.dll", scope.StrongNamedModuleName);
-			Assert.AreEqual(@"c:\Foo\StrongModule.dll", scope.ObtainDynamicModuleWithStrongName().FullyQualifiedName);
-			Assert.AreEqual(@"c:\Foo", scope.StrongNamedModuleDirectory);
-
-			Assert.AreEqual("WeakModule.dll", scope.WeakNamedModuleName);
-			Assert.AreEqual(@"d:\Bar\WeakModule.dll", scope.ObtainDynamicModuleWithWeakName().FullyQualifiedName);
-			Assert.AreEqual(@"d:\Bar", scope.WeakNamedModuleDirectory);
-		}
-
-		private static void CheckSignedSavedAssembly(string path)
-		{
-			Assert.IsTrue(File.Exists(path));
-
-			var assemblyName = AssemblyName.GetAssemblyName(path);
-			Assert.AreEqual(ModuleScope.DEFAULT_ASSEMBLY_NAME, assemblyName.Name);
-
-			var keyPairBytes = ModuleScope.GetKeyPair();
-			var keyPair = new StrongNameKeyPair(keyPairBytes);
-			var loadedPublicKey = assemblyName.GetPublicKey();
-
-			Assert.AreEqual(keyPair.PublicKey.Length, loadedPublicKey.Length);
-			for (var i = 0; i < keyPair.PublicKey.Length; ++i)
-				Assert.AreEqual(keyPair.PublicKey[i], loadedPublicKey[i]);
-		}
-
-		[Test]
-#if __MonoCS__
-		[Ignore("Expected: CastleDynProxy2.dll  But was:  /home/teamcity/buildagent/work/...")]
-#endif
-		public void SaveSigned()
-		{
-			var scope = new ModuleScope(true);
-			scope.ObtainDynamicModuleWithStrongName();
-
-			var path = ModuleScope.DEFAULT_FILE_NAME;
-			if (File.Exists(path))
-				File.Delete(path);
-
-			Assert.IsFalse(File.Exists(path));
-			var savedPath = scope.SaveAssembly();
-
-			Assert.AreEqual(savedPath, Path.GetFullPath(path));
-
-			CheckSignedSavedAssembly(path);
-			File.Delete(path);
-		}
-
-		[Test]
-#if __MonoCS__
-		[Ignore("Expected: CastleDynProxy2.dll  But was:  /home/teamcity/buildagent/work/...")]
-#endif
-		public void SaveUnsigned()
-		{
-			var scope = new ModuleScope(true);
-			scope.ObtainDynamicModuleWithWeakName();
-
-			var path = ModuleScope.DEFAULT_FILE_NAME;
-			if (File.Exists(path))
-				File.Delete(path);
-
-			Assert.IsFalse(File.Exists(path));
-			var savedPath = scope.SaveAssembly();
-
-			Assert.AreEqual(savedPath, Path.GetFullPath(path));
-
-			CheckUnsignedSavedAssembly(path);
-			File.Delete(path);
-		}
-
-		[Test]
-		public void SaveWithPath()
-		{
-			var strongModulePath = Path.GetTempFileName();
-			var weakModulePath = Path.GetTempFileName();
-
-			File.Delete(strongModulePath);
-			File.Delete(weakModulePath);
-
-			Assert.IsFalse(File.Exists(strongModulePath));
-			Assert.IsFalse(File.Exists(weakModulePath));
-
-			var scope = new ModuleScope(true,false, "Strong", strongModulePath, "Weak", weakModulePath);
-			scope.ObtainDynamicModuleWithStrongName();
-			scope.ObtainDynamicModuleWithWeakName();
-
-			scope.SaveAssembly(true);
-			scope.SaveAssembly(false);
-
-			Assert.IsTrue(File.Exists(strongModulePath));
-			Assert.IsTrue(File.Exists(weakModulePath));
-
-			File.Delete(strongModulePath);
-			File.Delete(weakModulePath);
-		}
-
-		private static void CheckUnsignedSavedAssembly(string path)
-		{
-			Assert.IsTrue(File.Exists(path));
-
-			var assemblyName = AssemblyName.GetAssemblyName(path);
-			Assert.AreEqual(ModuleScope.DEFAULT_ASSEMBLY_NAME, assemblyName.Name);
-
-			var loadedPublicKey = assemblyName.GetPublicKey();
-			Assert.IsNull(loadedPublicKey);
-		}
-
-		[Test]
-		public void SaveReturnsNullWhenNoModuleObtained()
-		{
-			var scope = new ModuleScope(true);
-			Assert.IsNull(scope.SaveAssembly());
-		}
-
-		[Test]
-		[ExpectedException(typeof (InvalidOperationException))]
-		public void SaveThrowsWhenMultipleAssembliesGenerated()
-		{
-			var scope = new ModuleScope(true);
-			scope.ObtainDynamicModuleWithStrongName();
-			scope.ObtainDynamicModuleWithWeakName();
-
-			scope.SaveAssembly();
-		}
-
-		[Test]
-		public void SaveWithFlagFalseDoesntThrowsWhenMultipleAssembliesGenerated()
-		{
-			var scope = new ModuleScope(false);
-			scope.ObtainDynamicModuleWithStrongName();
-			scope.ObtainDynamicModuleWithWeakName();
-
-			scope.SaveAssembly();
-		}
-
-		[Test]
-		public void ExplicitSaveWorksEvenWhenMultipleAssembliesGenerated()
-		{
-			var scope = new ModuleScope(true);
-			scope.ObtainDynamicModuleWithStrongName();
-			scope.ObtainDynamicModuleWithWeakName();
-
-			scope.SaveAssembly(true);
-			CheckSignedSavedAssembly(ModuleScope.DEFAULT_FILE_NAME);
-
-			scope.SaveAssembly(false);
-			CheckUnsignedSavedAssembly(ModuleScope.DEFAULT_FILE_NAME);
-
-			File.Delete(ModuleScope.DEFAULT_FILE_NAME);
-		}
-
-		[Test]
-		[ExpectedException(typeof (InvalidOperationException))]
-		public void ExplicitSaveThrowsWhenSpecifiedAssemblyNotGeneratedWeakName()
-		{
-			var scope = new ModuleScope(true);
-			scope.ObtainDynamicModuleWithStrongName();
-
-			scope.SaveAssembly(false);
-		}
-
-		[Test]
-		[ExpectedException(typeof (InvalidOperationException))]
-		public void ExplicitSaveThrowsWhenSpecifiedAssemblyNotGeneratedStrongName()
-		{
-			var scope = new ModuleScope(true);
-			scope.ObtainDynamicModuleWithWeakName();
-
-			scope.SaveAssembly(true);
-		}
-
-#if FEATURE_SERIALIZATION
-		[Test]
-		public void SavedAssemblyHasCacheMappings()
-		{
-			var scope = new ModuleScope(true);
-			scope.ObtainDynamicModuleWithWeakName();
-
-			var savedPath = scope.SaveAssembly();
-
-			CrossAppDomainCaller.RunInOtherAppDomain(delegate(object[] args)
-			                                         	{
-			                                         		var assembly = Assembly.LoadFrom((string) args[0]);
-			                                         		Assert.IsTrue(assembly.IsDefined(typeof (CacheMappingsAttribute), false));
-			                                         	},
-			                                         savedPath);
-
-			File.Delete(savedPath);
-		}
-
-		[Test]
-		public void CacheMappingsHoldTypes()
-		{
-			var scope = new ModuleScope(true);
-			var builder = new DefaultProxyBuilder(scope);
-			var cp = builder.CreateClassProxyType(typeof (object), Type.EmptyTypes, ProxyGenerationOptions.Default);
-
-			var savedPath = scope.SaveAssembly();
-
-			CrossAppDomainCaller.RunInOtherAppDomain(delegate(object[] args)
-			                                         	{
-			                                         		var assembly = Assembly.LoadFrom((string) args[0]);
-			                                         		var attribute =
-			                                         			(CacheMappingsAttribute)
-			                                         			assembly.GetCustomAttributes(typeof (CacheMappingsAttribute), false)[0];
-			                                         		var entries = attribute.GetDeserializedMappings();
-			                                         		Assert.AreEqual(1, entries.Count);
-
-			                                         		var key = new CacheKey(typeof (object), new Type[0],
-			                                         		                       ProxyGenerationOptions.Default);
-			                                         		Assert.IsTrue(entries.ContainsKey(key));
-			                                         		Assert.AreEqual(args[1], entries[key]);
-			                                         	},
-			                                         savedPath, cp.FullName);
-
-			File.Delete(savedPath);
-		}
-#endif
-
-		[Test]
-		public void GeneratedAssembliesDefaultName()
-		{
-			var scope = new ModuleScope();
-			var strong = scope.ObtainDynamicModuleWithStrongName();
-			var weak = scope.ObtainDynamicModuleWithWeakName();
-
-			Assert.AreEqual(ModuleScope.DEFAULT_ASSEMBLY_NAME, strong.Assembly.GetName().Name);
-			Assert.AreEqual(ModuleScope.DEFAULT_ASSEMBLY_NAME, weak.Assembly.GetName().Name);
-		}
-
-		[Test]
-		public void GeneratedAssembliesWithCustomName()
-		{
-			var scope = new ModuleScope(false,false, "Strong", "Module1.dll", "Weak", "Module2,dll");
-			var strong = scope.ObtainDynamicModuleWithStrongName();
-			var weak = scope.ObtainDynamicModuleWithWeakName();
-
-			Assert.AreEqual("Strong", strong.Assembly.GetName().Name);
-			Assert.AreEqual("Weak", weak.Assembly.GetName().Name);
-		}
-
-		[Test]
-		public void ModuleScopeDoesntTryToDeleteFromCurrentDirectory()
-		{
-			var moduleDirectory = Path.Combine(Environment.CurrentDirectory, "GeneratedDlls");
-			if (Directory.Exists(moduleDirectory))
-				Directory.Delete(moduleDirectory, true);
-
-			var strongModulePath = Path.Combine(moduleDirectory, "Strong.dll");
-			var weakModulePath = Path.Combine(moduleDirectory, "Weak.dll");
-
-			Directory.CreateDirectory(moduleDirectory);
-			var scope = new ModuleScope(true, false, "Strong", strongModulePath, "Weak", weakModulePath);
-
-			using (File.Create(Path.Combine(Environment.CurrentDirectory, "Strong.dll")))
-			{
-				scope.ObtainDynamicModuleWithStrongName();
-				scope.SaveAssembly(true); // this will throw if SaveAssembly tries to delete from the current directory
-			}
-
-			using (File.Create(Path.Combine(Environment.CurrentDirectory, "Weak.dll")))
-			{
-				scope.ObtainDynamicModuleWithWeakName();
-				scope.SaveAssembly(false); // this will throw if SaveAssembly tries to delete from the current directory
-			}
-
-			// Clean up the generated DLLs because the FileStreams are now closed
-			Directory.Delete(moduleDirectory, true);
-			File.Delete(Path.Combine(Environment.CurrentDirectory, "Strong.dll"));
-			File.Delete(Path.Combine(Environment.CurrentDirectory, "Weak.dll"));
-		}
-#endif
-
-		[Test]
-		public void DefaultProxyBuilderWithSpecificScope()
-		{
-			var scope = new ModuleScope(false);
-			var builder = new DefaultProxyBuilder(scope);
-			Assert.AreSame(scope, builder.ModuleScope);
-		}
-
-#if FEATURE_SERIALIZATION
-		[Test]
-		[ExpectedException(typeof (ArgumentException))]
-		public void LoadAssemblyIntoCache_InvalidAssembly()
-		{
-			var newScope = new ModuleScope(false);
-			newScope.LoadAssemblyIntoCache(Assembly.GetExecutingAssembly());
-		}
-
-		[Test]
-		public void LoadAssemblyIntoCache_CreateClassProxy()
-		{
-			CheckLoadAssemblyIntoCache(
-				builder => builder.CreateClassProxyType(typeof (object), null, ProxyGenerationOptions.Default));
-		}
-
-		[Test]
-		public void LoadAssemblyIntoCache_CreateInterfaceProxyTypeWithoutTarget()
-		{
-			CheckLoadAssemblyIntoCache(
-				delegate(IProxyBuilder builder)
-					{
-						return builder.CreateInterfaceProxyTypeWithoutTarget(typeof (IServiceProvider), new Type[0],
-						                                                     ProxyGenerationOptions.Default);
-					});
-		}
-
-		[Test]
-		public void LoadAssemblyIntoCache_CreateInterfaceProxyTypeWithTarget()
-		{
-			CheckLoadAssemblyIntoCache(
-				delegate(IProxyBuilder builder)
-					{
-						return builder.CreateInterfaceProxyTypeWithTarget(typeof (IMyInterface2), new Type[0], typeof (MyInterfaceImpl),
-						                                                  ProxyGenerationOptions.Default);
-					});
-		}
-
-		[Test]
-		public void LoadAssemblyIntoCache_CreateInterfaceProxyTypeWithTargetInterface()
-		{
-			CheckLoadAssemblyIntoCache(
-				delegate(IProxyBuilder builder)
-					{
-						return builder.CreateInterfaceProxyTypeWithTargetInterface(typeof (IMyInterface2), null,
-						                                                           ProxyGenerationOptions.Default);
-					});
-		}
-
-		[Test]
-		public void LoadAssemblyIntoCache_DifferentGenerationOptions()
-		{
-			var savedScope = new ModuleScope(true);
-			var builder = new DefaultProxyBuilder(savedScope);
-
-			var options1 = new ProxyGenerationOptions();
-			options1.AddMixinInstance(new DateTime());
-			var options2 = ProxyGenerationOptions.Default;
-
-			var cp1 = builder.CreateClassProxyType(typeof (object), Type.EmptyTypes, options1);
-			var cp2 = builder.CreateClassProxyType(typeof (object), Type.EmptyTypes, options2);
-			Assert.AreNotSame(cp1, cp2);
-			Assert.AreSame(cp1, builder.CreateClassProxyType(typeof (object), Type.EmptyTypes, options1));
-			Assert.AreSame(cp2, builder.CreateClassProxyType(typeof (object), Type.EmptyTypes, options2));
-
-			var path = savedScope.SaveAssembly();
-
-			CrossAppDomainCaller.RunInOtherAppDomain(delegate(object[] args)
-			                                         	{
-			                                         		var newScope = new ModuleScope(false);
-			                                         		var newBuilder = new DefaultProxyBuilder(newScope);
-
-			                                         		var assembly = Assembly.LoadFrom((string) args[0]);
-			                                         		newScope.LoadAssemblyIntoCache(assembly);
-
-			                                         		var newOptions1 = new ProxyGenerationOptions();
-			                                         		newOptions1.AddMixinInstance(new DateTime());
-			                                         		var newOptions2 = ProxyGenerationOptions.Default;
-
-			                                         		var loadedCP1 = newBuilder.CreateClassProxyType(typeof (object),
-			                                         		                                                Type.EmptyTypes,
-			                                         		                                                newOptions1);
-			                                         		var loadedCP2 = newBuilder.CreateClassProxyType(typeof (object),
-			                                         		                                                Type.EmptyTypes,
-			                                         		                                                newOptions2);
-			                                         		Assert.AreNotSame(loadedCP1, loadedCP2);
-			                                         		Assert.AreEqual(assembly, loadedCP1.Assembly);
-			                                         		Assert.AreEqual(assembly, loadedCP2.Assembly);
-			                                         	}, path);
-
-			File.Delete(path);
-		}
-
-		private delegate Type ProxyCreator(IProxyBuilder proxyBuilder);
-
-		private void CheckLoadAssemblyIntoCache(ProxyCreator creator)
-		{
-			var savedScope = new ModuleScope(true);
-			var builder = new DefaultProxyBuilder(savedScope);
-
-			var cp = creator(builder);
-			Assert.AreSame(cp, creator(builder));
-
-			var path = savedScope.SaveAssembly();
-
-			CrossAppDomainCaller.RunInOtherAppDomain(delegate(object[] args)
-			                                         	{
-			                                         		var newScope = new ModuleScope(false);
-			                                         		var newBuilder = new DefaultProxyBuilder(newScope);
-
-			                                         		var assembly = Assembly.LoadFrom((string) args[0]);
-			                                         		newScope.LoadAssemblyIntoCache(assembly);
-
-			                                         		var loadedCP = assembly.GetType((string) args[1]);
-			                                         		Assert.AreSame(loadedCP, ((ProxyCreator) args[2])(newBuilder));
-			                                         		Assert.AreEqual(assembly, ((ProxyCreator) args[2])(newBuilder).Assembly);
-			                                         	}, path, cp.FullName, creator);
-
-			File.Delete(path);
-		}
-#endif
-	}
+// Copyright 2004-2010 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.
+
+namespace Castle.DynamicProxy.Tests
+{
+	using System;
+	using System.IO;
+	using System.Reflection;
+	using Castle.DynamicProxy.Generators;
+	using Castle.DynamicProxy.Serialization;
+	using Castle.DynamicProxy.Tests.InterClasses;
+	using NUnit.Framework;
+
+	[TestFixture]
+	public class ModuleScopeTestCase
+	{
+		[Test]
+		public void ModuleScopeStoresModuleBuilder()
+		{
+			var scope = new ModuleScope();
+			var one = scope.ObtainDynamicModuleWithStrongName();
+			var two = scope.ObtainDynamicModuleWithStrongName();
+
+			Assert.AreSame(one, two);
+			Assert.AreSame(one.Assembly, two.Assembly);
+		}
+
+		[Test]
+		public void ModuleScopeCanHandleSignedAndUnsignedInParallel()
+		{
+			var scope = new ModuleScope();
+			Assert.IsNull(scope.StrongNamedModule);
+			Assert.IsNull(scope.WeakNamedModule);
+
+			var one = scope.ObtainDynamicModuleWithStrongName();
+			Assert.IsNotNull(scope.StrongNamedModule);
+			Assert.IsNull(scope.WeakNamedModule);
+			Assert.AreSame(one, scope.StrongNamedModule);
+
+			var two = scope.ObtainDynamicModuleWithWeakName();
+			Assert.IsNotNull(scope.StrongNamedModule);
+			Assert.IsNotNull(scope.WeakNamedModule);
+			Assert.AreSame(two, scope.WeakNamedModule);
+
+			Assert.AreNotSame(one, two);
+			Assert.AreNotSame(one.Assembly, two.Assembly);
+
+			var three = scope.ObtainDynamicModuleWithStrongName();
+			var four = scope.ObtainDynamicModuleWithWeakName();
+
+			Assert.AreSame(one, three);
+			Assert.AreSame(two, four);
+		}
+
+#if !SILVERLIGHT
+
+		[Test]
+#if __MonoCS__
+		[Ignore("Expected: /home/teamcity/buildagent/work/... But was: CastleDynProxy2.dll")]
+#endif
+		public void ImplicitModulePaths()
+		{
+			var scope = new ModuleScope(true);
+			Assert.AreEqual(ModuleScope.DEFAULT_FILE_NAME, scope.StrongNamedModuleName);
+			Assert.AreEqual(Path.Combine(Environment.CurrentDirectory, ModuleScope.DEFAULT_FILE_NAME),
+			                scope.ObtainDynamicModuleWithStrongName().FullyQualifiedName);
+			Assert.IsNull(scope.StrongNamedModuleDirectory);
+
+			Assert.AreEqual(ModuleScope.DEFAULT_FILE_NAME, scope.WeakNamedModuleName);
+			Assert.AreEqual(Path.Combine(Environment.CurrentDirectory, ModuleScope.DEFAULT_FILE_NAME),
+			                scope.ObtainDynamicModuleWithWeakName().FullyQualifiedName);
+			Assert.IsNull(scope.WeakNamedModuleDirectory);
+		}
+
+		[Test]
+#if __MonoCS__
+		[Ignore("Expected: /home/teamcity/buildagent/work/... But was: StrongModule.dll")]
+#endif
+		public void ExplicitModulePaths()
+		{
+			var scope = new ModuleScope(true, false, "Strong", "StrongModule.dll", "Weak", "WeakModule.dll");
+			Assert.AreEqual("StrongModule.dll", scope.StrongNamedModuleName);
+			Assert.AreEqual(Path.Combine(Environment.CurrentDirectory, "StrongModule.dll"),
+			                scope.ObtainDynamicModuleWithStrongName().FullyQualifiedName);
+			Assert.IsNull(scope.StrongNamedModuleDirectory);
+
+			Assert.AreEqual("WeakModule.dll", scope.WeakNamedModuleName);
+			Assert.AreEqual(Path.Combine(Environment.CurrentDirectory, "WeakModule.dll"),
+			                scope.ObtainDynamicModuleWithWeakName().FullyQualifiedName);
+			Assert.IsNull(scope.WeakNamedModuleDirectory);
+
+			scope = new ModuleScope(true, false, "Strong", @"c:\Foo\StrongModule.dll", "Weak", @"d:\Bar\WeakModule.dll");
+			Assert.AreEqual("StrongModule.dll", scope.StrongNamedModuleName);
+			Assert.AreEqual(@"c:\Foo\StrongModule.dll", scope.ObtainDynamicModuleWithStrongName().FullyQualifiedName);
+			Assert.AreEqual(@"c:\Foo", scope.StrongNamedModuleDirectory);
+
+			Assert.AreEqual("WeakModule.dll", scope.WeakNamedModuleName);
+			Assert.AreEqual(@"d:\Bar\WeakModule.dll", scope.ObtainDynamicModuleWithWeakName().FullyQualifiedName);
+			Assert.AreEqual(@"d:\Bar", scope.WeakNamedModuleDirectory);
+		}
+
+		private static void CheckSignedSavedAssembly(string path)
+		{
+			Assert.IsTrue(File.Exists(path));
+
+			var assemblyName = AssemblyName.GetAssemblyName(path);
+			Assert.AreEqual(ModuleScope.DEFAULT_ASSEMBLY_NAME, assemblyName.Name);
+
+			var keyPairBytes = ModuleScope.GetKeyPair();
+			var keyPair = new StrongNameKeyPair(keyPairBytes);
+			var loadedPublicKey = assemblyName.GetPublicKey();
+
+			Assert.AreEqual(keyPair.PublicKey.Length, loadedPublicKey.Length);
+			for (var i = 0; i < keyPair.PublicKey.Length; ++i)
+				Assert.AreEqual(keyPair.PublicKey[i], loadedPublicKey[i]);
+		}
+
+		[Test]
+#if __MonoCS__
+		[Ignore("Expected: CastleDynProxy2.dll  But was:  /home/teamcity/buildagent/work/...")]
+#endif
+		public void SaveSigned()
+		{
+			var scope = new ModuleScope(true);
+			scope.ObtainDynamicModuleWithStrongName();
+
+			var path = ModuleScope.DEFAULT_FILE_NAME;
+			if (File.Exists(path))
+				File.Delete(path);
+
+			Assert.IsFalse(File.Exists(path));
+			var savedPath = scope.SaveAssembly();
+
+			Assert.AreEqual(savedPath, Path.GetFullPath(path));
+
+			CheckSignedSavedAssembly(path);
+			File.Delete(path);
+		}
+
+		[Test]
+#if __MonoCS__
+		[Ignore("Expected: CastleDynProxy2.dll  But was:  /home/teamcity/buildagent/work/...")]
+#endif
+		public void SaveUnsigned()
+		{
+			var scope = new ModuleScope(true);
+			scope.ObtainDynamicModuleWithWeakName();
+
+			var path = ModuleScope.DEFAULT_FILE_NAME;
+			if (File.Exists(path))
+				File.Delete(path);
+
+			Assert.IsFalse(File.Exists(path));
+			var savedPath = scope.SaveAssembly();
+
+			Assert.AreEqual(savedPath, Path.GetFullPath(path));
+
+			CheckUnsignedSavedAssembly(path);
+			File.Delete(path);
+		}
+
+		[Test]
+		public void SaveWithPath()
+		{
+			var strongModulePath = Path.GetTempFileName();
+			var weakModulePath = Path.GetTempFileName();
+
+			File.Delete(strongModulePath);
+			File.Delete(weakModulePath);
+
+			Assert.IsFalse(File.Exists(strongModulePath));
+			Assert.IsFalse(File.Exists(weakModulePath));
+
+			var scope = new ModuleScope(true,false, "Strong", strongModulePath, "Weak", weakModulePath);
+			scope.ObtainDynamicModuleWithStrongName();
+			scope.ObtainDynamicModuleWithWeakName();
+
+			scope.SaveAssembly(true);
+			scope.SaveAssembly(false);
+
+			Assert.IsTrue(File.Exists(strongModulePath));
+			Assert.IsTrue(File.Exists(weakModulePath));
+
+			File.Delete(strongModulePath);
+			File.Delete(weakModulePath);
+		}
+
+		private static void CheckUnsignedSavedAssembly(string path)
+		{
+			Assert.IsTrue(File.Exists(path));
+
+			var assemblyName = AssemblyName.GetAssemblyName(path);
+			Assert.AreEqual(ModuleScope.DEFAULT_ASSEMBLY_NAME, assemblyName.Name);
+
+			var loadedPublicKey = assemblyName.GetPublicKey();
+			Assert.IsNull(loadedPublicKey);
+		}
+
+		[Test]
+		public void SaveReturnsNullWhenNoModuleObtained()
+		{
+			var scope = new ModuleScope(true);
+			Assert.IsNull(scope.SaveAssembly());
+		}
+
+		[Test]
+		[ExpectedException(typeof (InvalidOperationException))]
+		public void SaveThrowsWhenMultipleAssembliesGenerated()
+		{
+			var scope = new ModuleScope(true);
+			scope.ObtainDynamicModuleWithStrongName();
+			scope.ObtainDynamicModuleWithWeakName();
+
+			scope.SaveAssembly();
+		}
+
+		[Test]
+		public void SaveWithFlagFalseDoesntThrowsWhenMultipleAssembliesGenerated()
+		{
+			var scope = new ModuleScope(false);
+			scope.ObtainDynamicModuleWithStrongName();
+			scope.ObtainDynamicModuleWithWeakName();
+
+			scope.SaveAssembly();
+		}
+
+		[Test]
+		public void ExplicitSaveWorksEvenWhenMultipleAssembliesGenerated()
+		{
+			var scope = new ModuleScope(true);
+			scope.ObtainDynamicModuleWithStrongName();
+			scope.ObtainDynamicModuleWithWeakName();
+
+			scope.SaveAssembly(true);
+			CheckSignedSavedAssembly(ModuleScope.DEFAULT_FILE_NAME);
+
+			scope.SaveAssembly(false);
+			CheckUnsignedSavedAssembly(ModuleScope.DEFAULT_FILE_NAME);
+
+			File.Delete(ModuleScope.DEFAULT_FILE_NAME);
+		}
+
+		[Test]
+		[ExpectedException(typeof (InvalidOperationException))]
+		public void ExplicitSaveThrowsWhenSpecifiedAssemblyNotGeneratedWeakName()
+		{
+			var scope = new ModuleScope(true);
+			scope.ObtainDynamicModuleWithStrongName();
+
+			scope.SaveAssembly(false);
+		}
+
+		[Test]
+		[ExpectedException(typeof (InvalidOperationException))]
+		public void ExplicitSaveThrowsWhenSpecifiedAssemblyNotGeneratedStrongName()
+		{
+			var scope = new ModuleScope(true);
+			scope.ObtainDynamicModuleWithWeakName();
+
+			scope.SaveAssembly(true);
+		}
+
+#if FEATURE_SERIALIZATION
+		[Test]
+		public void SavedAssemblyHasCacheMappings()
+		{
+			var scope = new ModuleScope(true);
+			scope.ObtainDynamicModuleWithWeakName();
+
+			var savedPath = scope.SaveAssembly();
+
+			CrossAppDomainCaller.RunInOtherAppDomain(delegate(object[] args)
+			                                         	{
+			                                         		var assembly = Assembly.LoadFrom((string) args[0]);
+			                                         		Assert.IsTrue(assembly.IsDefined(typeof (CacheMappingsAttribute), false));
+			                                         	},
+			                                         savedPath);
+
+			File.Delete(savedPath);
+		}
+
+		[Test]
+		public void CacheMappingsHoldTypes()
+		{
+			var scope = new ModuleScope(true);
+			var builder = new DefaultProxyBuilder(scope);
+			var cp = builder.CreateClassProxyType(typeof (object), Type.EmptyTypes, ProxyGenerationOptions.Default);
+
+			var savedPath = scope.SaveAssembly();
+
+			CrossAppDomainCaller.RunInOtherAppDomain(delegate(object[] args)
+			                                         	{
+			                                         		var assembly = Assembly.LoadFrom((string) args[0]);
+			                                         		var attribute =
+			                                         			(CacheMappingsAttribute)
+			                                         			assembly.GetCustomAttributes(typeof (CacheMappingsAttribute), false)[0];
+			                                         		var entries = attribute.GetDeserializedMappings();
+			                                         		Assert.AreEqual(1, entries.Count);
+
+			                                         		var key = new CacheKey(typeof (object), new Type[0],
+			                                         		                       ProxyGenerationOptions.Default);
+			                                         		Assert.IsTrue(entries.ContainsKey(key));
+			                                         		Assert.AreEqual(args[1], entries[key]);
+			                                         	},
+			                                         savedPath, cp.FullName);
+
+			File.Delete(savedPath);
+		}
+#endif
+
+		[Test]
+		public void GeneratedAssembliesDefaultName()
+		{
+			var scope = new ModuleScope();
+			var strong = scope.ObtainDynamicModuleWithStrongName();
+			var weak = scope.ObtainDynamicModuleWithWeakName();
+
+			Assert.AreEqual(ModuleScope.DEFAULT_ASSEMBLY_NAME, strong.Assembly.GetName().Name);
+			Assert.AreEqual(ModuleScope.DEFAULT_ASSEMBLY_NAME, weak.Assembly.GetName().Name);
+		}
+
+		[Test]
+		public void GeneratedAssembliesWithCustomName()
+		{
+			var scope = new ModuleScope(false,false, "Strong", "Module1.dll", "Weak", "Module2,dll");
+			var strong = scope.ObtainDynamicModuleWithStrongName();
+			var weak = scope.ObtainDynamicModuleWithWeakName();
+
+			Assert.AreEqual("Strong", strong.Assembly.GetName().Name);
+			Assert.AreEqual("Weak", weak.Assembly.GetName().Name);
+		}
+
+		[Test]
+		public void ModuleScopeDoesntTryToDeleteFromCurrentDirectory()
+		{
+			var moduleDirectory = Path.Combine(Environment.CurrentDirectory, "GeneratedDlls");
+			if (Directory.Exists(moduleDirectory))
+				Directory.Delete(moduleDirectory, true);
+
+			var strongModulePath = Path.Combine(moduleDirectory, "Strong.dll");
+			var weakModulePath = Path.Combine(moduleDirectory, "Weak.dll");
+
+			Directory.CreateDirectory(moduleDirectory);
+			var scope = new ModuleScope(true, false, "Strong", strongModulePath, "Weak", weakModulePath);
+
+			using (File.Create(Path.Combine(Environment.CurrentDirectory, "Strong.dll")))
+			{
+				scope.ObtainDynamicModuleWithStrongName();
+				scope.SaveAssembly(true); // this will throw if SaveAssembly tries to delete from the current directory
+			}
+
+			using (File.Create(Path.Combine(Environment.CurrentDirectory, "Weak.dll")))
+			{
+				scope.ObtainDynamicModuleWithWeakName();
+				scope.SaveAssembly(false); // this will throw if SaveAssembly tries to delete from the current directory
+			}
+
+			// Clean up the generated DLLs because the FileStreams are now closed
+			Directory.Delete(moduleDirectory, true);
+			File.Delete(Path.Combine(Environment.CurrentDirectory, "Strong.dll"));
+			File.Delete(Path.Combine(Environment.CurrentDirectory, "Weak.dll"));
+		}
+#endif
+
+		[Test]
+		public void DefaultProxyBuilderWithSpecificScope()
+		{
+			var scope = new ModuleScope(false);
+			var builder = new DefaultProxyBuilder(scope);
+			Assert.AreSame(scope, builder.ModuleScope);
+		}
+
+#if FEATURE_SERIALIZATION
+		[Test]
+		[ExpectedException(typeof (ArgumentException))]
+		public void LoadAssemblyIntoCache_InvalidAssembly()
+		{
+			var newScope = new ModuleScope(false);
+			newScope.LoadAssemblyIntoCache(Assembly.GetExecutingAssembly());
+		}
+
+		[Test]
+		public void LoadAssemblyIntoCache_CreateClassProxy()
+		{
+			CheckLoadAssemblyIntoCache(
+				builder => builder.CreateClassProxyType(typeof (object), null, ProxyGenerationOptions.Default));
+		}
+
+		[Test]
+		public void LoadAssemblyIntoCache_CreateInterfaceProxyTypeWithoutTarget()
+		{
+			CheckLoadAssemblyIntoCache(
+				delegate(IProxyBuilder builder)
+					{
+						return builder.CreateInterfaceProxyTypeWithoutTarget(typeof (IServiceProvider), new Type[0],
+						                                                     ProxyGenerationOptions.Default);
+					});
+		}
+
+		[Test]
+		public void LoadAssemblyIntoCache_CreateInterfaceProxyTypeWithTarget()
+		{
+			CheckLoadAssemblyIntoCache(
+				delegate(IProxyBuilder builder)
+					{
+						return builder.CreateInterfaceProxyTypeWithTarget(typeof (IMyInterface2), new Type[0], typeof (MyInterfaceImpl),
+						                                                  ProxyGenerationOptions.Default);
+					});
+		}
+
+		[Test]
+		public void LoadAssemblyIntoCache_CreateInterfaceProxyTypeWithTargetInterface()
+		{
+			CheckLoadAssemblyIntoCache(
+				delegate(IProxyBuilder builder)
+					{
+						return builder.CreateInterfaceProxyTypeWithTargetInterface(typeof (IMyInterface2), null,
+						                                                           ProxyGenerationOptions.Default);
+					});
+		}
+
+		[Test]
+		public void LoadAssemblyIntoCache_DifferentGenerationOptions()
+		{
+			var savedScope = new ModuleScope(true);
+			var builder = new DefaultProxyBuilder(savedScope);
+
+			var options1 = new ProxyGenerationOptions();
+			options1.AddMixinInstance(new DateTime());
+			var options2 = ProxyGenerationOptions.Default;
+
+			var cp1 = builder.CreateClassProxyType(typeof (object), Type.EmptyTypes, options1);
+			var cp2 = builder.CreateClassProxyType(typeof (object), Type.EmptyTypes, options2);
+			Assert.AreNotSame(cp1, cp2);
+			Assert.AreSame(cp1, builder.CreateClassProxyType(typeof (object), Type.EmptyTypes, options1));
+			Assert.AreSame(cp2, builder.CreateClassProxyType(typeof (object), Type.EmptyTypes, options2));
+
+			var path = savedScope.SaveAssembly();
+
+			CrossAppDomainCaller.RunInOtherAppDomain(delegate(object[] args)
+			                                         	{
+			                                         		var newScope = new ModuleScope(false);
+			                                         		var newBuilder = new DefaultProxyBuilder(newScope);
+
+			                                         		var assembly = Assembly.LoadFrom((string) args[0]);
+			                                         		newScope.LoadAssemblyIntoCache(assembly);
+
+			                                         		var newOptions1 = new ProxyGenerationOptions();
+			                                         		newOptions1.AddMixinInstance(new DateTime());
+			                                         		var newOptions2 = ProxyGenerationOptions.Default;
+
+			                                         		var loadedCP1 = newBuilder.CreateClassProxyType(typeof (object),
+			                                         		                                                Type.EmptyTypes,
+			                                         		                                                newOptions1);
+			                                         		var loadedCP2 = newBuilder.CreateClassProxyType(typeof (object),
+			                                         		                                                Type.EmptyTypes,
+			                                         		                                                newOptions2);
+			                                         		Assert.AreNotSame(loadedCP1, loadedCP2);
+			                                         		Assert.AreEqual(assembly, loadedCP1.Assembly);
+			                                         		Assert.AreEqual(assembly, loadedCP2.Assembly);
+			                                         	}, path);
+
+			File.Delete(path);
+		}
+
+		private delegate Type ProxyCreator(IProxyBuilder proxyBuilder);
+
+		private void CheckLoadAssemblyIntoCache(ProxyCreator creator)
+		{
+			var savedScope = new ModuleScope(true);
+			var builder = new DefaultProxyBuilder(savedScope);
+
+			var cp = creator(builder);
+			Assert.AreSame(cp, creator(builder));
+
+			var path = savedScope.SaveAssembly();
+
+			CrossAppDomainCaller.RunInOtherAppDomain(delegate(object[] args)
+			                                         	{
+			                                         		var newScope = new ModuleScope(false);
+			                                         		var newBuilder = new DefaultProxyBuilder(newScope);
+
+			                                         		var assembly = Assembly.LoadFrom((string) args[0]);
+			                                         		newScope.LoadAssemblyIntoCache(assembly);
+
+			                                         		var loadedCP = assembly.GetType((string) args[1]);
+			                                         		Assert.AreSame(loadedCP, ((ProxyCreator) args[2])(newBuilder));
+			                                         		Assert.AreEqual(assembly, ((ProxyCreator) args[2])(newBuilder).Assembly);
+			                                         	}, path, cp.FullName, creator);
+
+			File.Delete(path);
+		}
+#endif
+	}
 }
\ No newline at end of file
diff --git a/src/Castle.Core.Tests/PersistentProxyBuilderTestCase.cs b/src/Castle.Core.Tests/PersistentProxyBuilderTestCase.cs
index 09299f0..98a99d0 100644
--- a/src/Castle.Core.Tests/PersistentProxyBuilderTestCase.cs
+++ b/src/Castle.Core.Tests/PersistentProxyBuilderTestCase.cs
@@ -1,51 +1,51 @@
-// Copyright 2004-2010 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_SERIALIZATION
-
-namespace Castle.DynamicProxy.Tests
-{
-	using System;
-	using System.IO;
-	using NUnit.Framework;
-
-	[TestFixture]
-	public class PersistentProxyBuilderTestCase
-	{
-		[Test]
-		public void PersistentProxyBuilder_NullIfNothingSaved()
-		{
-			PersistentProxyBuilder builder = new PersistentProxyBuilder();
-			string path = builder.SaveAssembly();
-			Assert.IsNull(path);
-		}
-
-		[Test]
-#if __MonoCS__
-		[Ignore("Expected: True  But was:  False")]
-#endif
-		public void PersistentProxyBuilder_SavesSignedFile()
-		{
-			PersistentProxyBuilder builder = new PersistentProxyBuilder();
-			builder.CreateClassProxyType(typeof(object), Type.EmptyTypes, ProxyGenerationOptions.Default);
-			string path = builder.SaveAssembly();
-			Assert.IsNotNull(path);
-			Assert.IsNotEmpty(path);
-			Assert.IsTrue(Path.IsPathRooted(path));
-			Assert.IsTrue(path.EndsWith(ModuleScope.DEFAULT_FILE_NAME));
-		}
-	}
-}
-
+// Copyright 2004-2010 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_SERIALIZATION
+
+namespace Castle.DynamicProxy.Tests
+{
+	using System;
+	using System.IO;
+	using NUnit.Framework;
+
+	[TestFixture]
+	public class PersistentProxyBuilderTestCase
+	{
+		[Test]
+		public void PersistentProxyBuilder_NullIfNothingSaved()
+		{
+			PersistentProxyBuilder builder = new PersistentProxyBuilder();
+			string path = builder.SaveAssembly();
+			Assert.IsNull(path);
+		}
+
+		[Test]
+#if __MonoCS__
+		[Ignore("Expected: True  But was:  False")]
+#endif
+		public void PersistentProxyBuilder_SavesSignedFile()
+		{
+			PersistentProxyBuilder builder = new PersistentProxyBuilder();
+			builder.CreateClassProxyType(typeof(object), Type.EmptyTypes, ProxyGenerationOptions.Default);
+			string path = builder.SaveAssembly();
+			Assert.IsNotNull(path);
+			Assert.IsNotEmpty(path);
+			Assert.IsTrue(Path.IsPathRooted(path));
+			Assert.IsTrue(path.EndsWith(ModuleScope.DEFAULT_FILE_NAME));
+		}
+	}
+}
+
 #endif
\ No newline at end of file
diff --git a/src/Castle.Core/Castle.Core.csproj b/src/Castle.Core/Castle.Core.csproj
index dbac311..17dea0d 100644
--- a/src/Castle.Core/Castle.Core.csproj
+++ b/src/Castle.Core/Castle.Core.csproj
@@ -156,15 +156,12 @@
     <Optimize>false</Optimize>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Mono43-Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>bin\NET45-Release\</OutputPath>
     <DefineConstants>TRACE;DOTNET40 DOTNET45 FEATURE_SERIALIZATION</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     <DocumentationFile>bin\Mono43-Release\Castle.Core.xml</DocumentationFile>
-    <PlatformTarget>AnyCPU</PlatformTarget>
     <NoWarn>1591</NoWarn>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
diff --git a/src/Castle.Services.Logging.NLogIntegration/Castle.Services.Logging.NLogIntegration.csproj b/src/Castle.Services.Logging.NLogIntegration/Castle.Services.Logging.NLogIntegration.csproj
index 662bb58..3dd4067 100644
--- a/src/Castle.Services.Logging.NLogIntegration/Castle.Services.Logging.NLogIntegration.csproj
+++ b/src/Castle.Services.Logging.NLogIntegration/Castle.Services.Logging.NLogIntegration.csproj
@@ -219,8 +219,6 @@
     <DefineConstants>TRACE;FEATURE_SERIALIZATION</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
-    <PlatformTarget>AnyCPU</PlatformTarget>
     <FileAlignment>4096</FileAlignment>
     <BaseAddress>285212672</BaseAddress>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
diff --git a/src/Castle.Services.Logging.SerilogIntegration/Castle.Services.Logging.SerilogIntegration.csproj b/src/Castle.Services.Logging.SerilogIntegration/Castle.Services.Logging.SerilogIntegration.csproj
index 907e9ff..000fff9 100644
--- a/src/Castle.Services.Logging.SerilogIntegration/Castle.Services.Logging.SerilogIntegration.csproj
+++ b/src/Castle.Services.Logging.SerilogIntegration/Castle.Services.Logging.SerilogIntegration.csproj
@@ -127,7 +127,6 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
-    <PlatformTarget>AnyCPU</PlatformTarget>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Mono43-Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
diff --git a/src/Castle.Services.Logging.log4netIntegration/Castle.Services.Logging.log4netIntegration.csproj b/src/Castle.Services.Logging.log4netIntegration/Castle.Services.Logging.log4netIntegration.csproj
index b80a2a7..c97ab38 100644
--- a/src/Castle.Services.Logging.log4netIntegration/Castle.Services.Logging.log4netIntegration.csproj
+++ b/src/Castle.Services.Logging.log4netIntegration/Castle.Services.Logging.log4netIntegration.csproj
@@ -178,8 +178,6 @@
     <DefineConstants>TRACE;FEATURE_SERIALIZATION</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
-    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
-    <PlatformTarget>AnyCPU</PlatformTarget>
     <FileAlignment>4096</FileAlignment>
     <BaseAddress>285212672</BaseAddress>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
