diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props
index c3010a103..adfe120df 100644
--- a/src/Directory.Packages.props
+++ b/src/Directory.Packages.props
@@ -17,8 +17,8 @@
-
-
+
+
@@ -33,7 +33,7 @@
-
+
@@ -53,8 +53,7 @@
-
-
+
@@ -66,20 +65,23 @@
-
+
-
+
+
+
+
+
-
-
\ No newline at end of file
+
diff --git a/src/ReactiveUI.DI.Tests/AutoFacReactiveUIDependencyTests.cs b/src/ReactiveUI.DI.Tests/AutoFacReactiveUIDependencyTests.cs
index 302f95e2c..14910ba87 100644
--- a/src/ReactiveUI.DI.Tests/AutoFacReactiveUIDependencyTests.cs
+++ b/src/ReactiveUI.DI.Tests/AutoFacReactiveUIDependencyTests.cs
@@ -66,7 +66,7 @@ public void AutoFacWhenAnyTest()
var builder = new ContainerBuilder();
var autofacResolver = builder.UseAutofacDependencyResolver();
- Locator.CurrentMutable.RegisterConstant(new ActivatingViewFetcher(), typeof(IActivationForViewFetcher));
+ Locator.CurrentMutable.RegisterConstant(new ActivatingViewFetcher());
autofacResolver.InitializeSplat();
autofacResolver.InitializeReactiveUI();
_ = builder.Build();
diff --git a/src/ReactiveUI.DI.Tests/ReactiveUI.DI.Tests.csproj b/src/ReactiveUI.DI.Tests/ReactiveUI.DI.Tests.csproj
index 11afd7322..488f1a66d 100644
--- a/src/ReactiveUI.DI.Tests/ReactiveUI.DI.Tests.csproj
+++ b/src/ReactiveUI.DI.Tests/ReactiveUI.DI.Tests.csproj
@@ -1,7 +1,7 @@
net472;net8.0;net9.0
- $(NoWarn);1591;CA1707;SA1633;CA2000
+ $(NoWarn);1591;CA1707;SA1633;CA2000;CA1515
false
enable
diff --git a/src/Splat.Autofac.Tests/DependencyResolverTests.cs b/src/Splat.Autofac.Tests/DependencyResolverTests.cs
index 3818e5c24..c4475f9b9 100644
--- a/src/Splat.Autofac.Tests/DependencyResolverTests.cs
+++ b/src/Splat.Autofac.Tests/DependencyResolverTests.cs
@@ -163,9 +163,7 @@ public void AutofacDependencyResolver_Should_ReturnRegisteredLogger()
var autofacResolver = builder.UseAutofacDependencyResolver();
- Locator.CurrentMutable.RegisterConstant(
- new FuncLogManager(type => new WrappingFullLogger(new ConsoleLogger())),
- typeof(ILogManager));
+ Locator.CurrentMutable.RegisterConstant(new FuncLogManager(type => new WrappingFullLogger(new ConsoleLogger())));
autofacResolver.SetLifetimeScope(builder.Build());
diff --git a/src/Splat.Avalonia.DryIoc1.Tests/Splat.Avalonia.DryIoc1.Tests.csproj b/src/Splat.Avalonia.DryIoc1.Tests/Splat.Avalonia.DryIoc1.Tests.csproj
index 4d941632b..553a0fd61 100644
--- a/src/Splat.Avalonia.DryIoc1.Tests/Splat.Avalonia.DryIoc1.Tests.csproj
+++ b/src/Splat.Avalonia.DryIoc1.Tests/Splat.Avalonia.DryIoc1.Tests.csproj
@@ -3,7 +3,7 @@
net8.0;net9.0
enable
enable
- $(NoWarn);1591;CA1707;SA1600;SA1601;SA1633;CA2000
+ $(NoWarn);1591;CA1707;SA1600;SA1601;SA1633;CA2000;CA1515
false
true
$(DefineConstants);DRYIOC1
diff --git a/src/Splat.Avalonia.DryIoc2.Tests/Splat.Avalonia.DryIoc2.Tests.csproj b/src/Splat.Avalonia.DryIoc2.Tests/Splat.Avalonia.DryIoc2.Tests.csproj
index 1b4852ded..d299d044a 100644
--- a/src/Splat.Avalonia.DryIoc2.Tests/Splat.Avalonia.DryIoc2.Tests.csproj
+++ b/src/Splat.Avalonia.DryIoc2.Tests/Splat.Avalonia.DryIoc2.Tests.csproj
@@ -3,7 +3,7 @@
net8.0;net9.0
enable
enable
- $(NoWarn);1591;CA1707;SA1600;SA1601;SA1633;CA2000
+ $(NoWarn);1591;CA1707;SA1600;SA1601;SA1633;CA2000;CA1515
false
true
$(DefineConstants);DRYIOC2
diff --git a/src/Splat.Avalonia.Microsoft1.Tests/Splat.Avalonia.Microsoft1.Tests.csproj b/src/Splat.Avalonia.Microsoft1.Tests/Splat.Avalonia.Microsoft1.Tests.csproj
index d91114cdd..971f6f644 100644
--- a/src/Splat.Avalonia.Microsoft1.Tests/Splat.Avalonia.Microsoft1.Tests.csproj
+++ b/src/Splat.Avalonia.Microsoft1.Tests/Splat.Avalonia.Microsoft1.Tests.csproj
@@ -3,7 +3,7 @@
net8.0;net9.0
enable
enable
- $(NoWarn);1591;CA1707;SA1600;SA1601;SA1633;CA2000
+ $(NoWarn);1591;CA1707;SA1600;SA1601;SA1633;CA2000;CA1515
false
true
$(DefineConstants);MICROSOFT1
diff --git a/src/Splat.Avalonia.Microsoft2.Tests/Splat.Avalonia.Microsoft2.Tests.csproj b/src/Splat.Avalonia.Microsoft2.Tests/Splat.Avalonia.Microsoft2.Tests.csproj
index 9add5b3a5..e4e2d43ac 100644
--- a/src/Splat.Avalonia.Microsoft2.Tests/Splat.Avalonia.Microsoft2.Tests.csproj
+++ b/src/Splat.Avalonia.Microsoft2.Tests/Splat.Avalonia.Microsoft2.Tests.csproj
@@ -3,7 +3,7 @@
net8.0;net9.0
enable
enable
- $(NoWarn);1591;CA1707;SA1600;SA1601;SA1633;CA2000
+ $(NoWarn);1591;CA1707;SA1600;SA1601;SA1633;CA2000;CA1515
false
true
$(DefineConstants);MICROSOFT2
diff --git a/src/Splat.Avalonia.Tests/Splat.Avalonia.Tests.csproj b/src/Splat.Avalonia.Tests/Splat.Avalonia.Tests.csproj
index 0a04e2730..100a6ff16 100644
--- a/src/Splat.Avalonia.Tests/Splat.Avalonia.Tests.csproj
+++ b/src/Splat.Avalonia.Tests/Splat.Avalonia.Tests.csproj
@@ -3,7 +3,7 @@
net8.0;net9.0
enable
enable
- $(NoWarn);1591;CA1707;SA1600;SA1601;SA1633;CA2000
+ $(NoWarn);1591;CA1707;SA1600;SA1601;SA1633;CA2000;CA1515
false
true
$(DefineConstants);MAIN
diff --git a/src/Splat.Drawing.Tests/Splat.Drawing.Tests.csproj b/src/Splat.Drawing.Tests/Splat.Drawing.Tests.csproj
index 1ed795b26..7d3b32ff3 100644
--- a/src/Splat.Drawing.Tests/Splat.Drawing.Tests.csproj
+++ b/src/Splat.Drawing.Tests/Splat.Drawing.Tests.csproj
@@ -3,7 +3,7 @@
net8.0-windows10.0.17763.0;net9.0-windows10.0.17763.0
false
- $(NoWarn);1591;CA1707;SA1633;CA2000;CA1034
+ $(NoWarn);1591;CA1707;SA1633;CA2000;CA1034;CA1515
enable
true
true
diff --git a/src/Splat.Drawing/Platforms/ReflectionStubs.cs b/src/Splat.Drawing/Platforms/ReflectionStubs.cs
index 2d5e614f0..9701ef8f7 100644
--- a/src/Splat.Drawing/Platforms/ReflectionStubs.cs
+++ b/src/Splat.Drawing/Platforms/ReflectionStubs.cs
@@ -3,12 +3,17 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
+using System.Diagnostics.CodeAnalysis;
using System.Reflection;
namespace Splat;
internal static class ReflectionStubs
{
+#if NET6_0_OR_GREATER
+ [RequiresUnreferencedCode("Type.GetField() may be trimmed.")]
+ [RequiresDynamicCode("Type.GetField() may be trimmed.")]
+#endif
public static FieldInfo? GetField(this Type value, string name, BindingFlags flags = default)
{
var ti = value.GetTypeInfo();
@@ -18,6 +23,10 @@ internal static class ReflectionStubs
: ti.BaseType.GetField(name, flags);
}
+#if NET6_0_OR_GREATER
+ [RequiresUnreferencedCode("Type.GetMethod() may be trimmed.")]
+ [RequiresDynamicCode("Type.GetMethod() may be trimmed.")]
+#endif
public static MethodInfo? GetMethod(this Type value, string name, BindingFlags flags = default)
{
var ti = value.GetTypeInfo();
@@ -27,6 +36,10 @@ internal static class ReflectionStubs
: ti.BaseType.GetMethod(name, flags);
}
+#if NET6_0_OR_GREATER
+ [RequiresUnreferencedCode("Type.GetProperty() may be trimmed.")]
+ [RequiresDynamicCode("Type.GetProperty() may be trimmed.")]
+#endif
public static PropertyInfo? GetProperty(this Type value, string name, BindingFlags flags = default)
{
var ti = value.GetTypeInfo();
@@ -36,6 +49,10 @@ internal static class ReflectionStubs
: ti.BaseType.GetProperty(name, flags);
}
+#if NET6_0_OR_GREATER
+ [RequiresUnreferencedCode("Type.GetEvent() may be trimmed.")]
+ [RequiresDynamicCode("Type.GetEvent() may be trimmed.")]
+#endif
public static EventInfo? GetEvent(this Type value, string name, BindingFlags flags = default)
{
var ti = value.GetTypeInfo();
@@ -45,10 +62,22 @@ internal static class ReflectionStubs
: ti.BaseType.GetEvent(name, flags);
}
+#if NET6_0_OR_GREATER
+ [RequiresUnreferencedCode("Type.GetProperties() may be trimmed.")]
+ [RequiresDynamicCode("Type.GetProperties() may be trimmed.")]
+#endif
public static IEnumerable GetProperties(this Type value) => value.GetTypeInfo().DeclaredProperties;
+#if NET6_0_OR_GREATER
+ [RequiresUnreferencedCode("Type.GetFields() may be trimmed.")]
+ [RequiresDynamicCode("Type.GetFields() may be trimmed.")]
+#endif
public static IEnumerable GetFields(this Type value) => value.GetTypeInfo().DeclaredFields;
+#if NET6_0_OR_GREATER
+ [RequiresUnreferencedCode("Type.GetMethod() may be trimmed.")]
+ [RequiresDynamicCode("Type.GetMethod() may be trimmed.")]
+#endif
public static MethodInfo? GetMethod(this Type value, string methodName, Type[] paramTypes, BindingFlags flags = default)
{
var ti = value.GetTypeInfo();
@@ -60,6 +89,10 @@ internal static class ReflectionStubs
: ti.BaseType.GetMethod(methodName, paramTypes, flags);
}
+#if NET6_0_OR_GREATER
+ [RequiresUnreferencedCode("Type.GetMethods() may be trimmed.")]
+ [RequiresDynamicCode("Type.GetMethods() may be trimmed.")]
+#endif
public static IEnumerable GetMethods(this Type value) => value.GetTypeInfo().DeclaredMethods;
public static IEnumerable