diff --git a/src/Discord.Net.Commands/Discord.Net.Commands.csproj b/src/Discord.Net.Commands/Discord.Net.Commands.csproj
index 94e58acf..0f15ea79 100644
--- a/src/Discord.Net.Commands/Discord.Net.Commands.csproj
+++ b/src/Discord.Net.Commands/Discord.Net.Commands.csproj
@@ -19,4 +19,7 @@
+
+
+
diff --git a/src/Discord.Net.Commands/Utilities/ReflectionUtils.cs b/src/Discord.Net.Commands/Utilities/ReflectionUtils.cs
index 28984448..2dcec2d6 100644
--- a/src/Discord.Net.Commands/Utilities/ReflectionUtils.cs
+++ b/src/Discord.Net.Commands/Utilities/ReflectionUtils.cs
@@ -1,3 +1,4 @@
+using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -21,11 +22,11 @@ namespace Discord.Commands
{
var args = new object[parameters.Length];
for (int i = 0; i < parameters.Length; i++)
- args[i] = GetMember(commands, services, parameters[i].ParameterType, typeInfo);
+ args[i] = GetMember(commands, services, parameters[i].ParameterType, typeInfo, parameters[i].GetCustomAttributes());
var obj = InvokeConstructor(constructor, args, typeInfo);
foreach (var property in properties)
- property.SetValue(obj, GetMember(commands, services, property.PropertyType, typeInfo));
+ property.SetValue(obj, GetMember(commands, services, property.PropertyType, typeInfo, null));
return obj;
};
}
@@ -64,13 +65,20 @@ namespace Discord.Commands
}
return result.ToArray();
}
- private static object GetMember(CommandService commands, IServiceProvider services, Type memberType, TypeInfo ownerType)
+ private static object GetMember(CommandService commands, IServiceProvider services, Type memberType, TypeInfo ownerType, IEnumerable