-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
When creating or adding your own plugin, if you have an ILogger with a DependencyAttribute (copy and paste the devtools plugin then modified) an exception will be thrown on line 90 of AppPlugins.cs (property.SetValue(plugin, dependency);) this is because the type in the plugin is Microsoft.Extensions.Logging.Ilogger and not Micrsoft.Teams.Common.Logging.Ilogger. The Container.Resolve code is resolving anything with the string "ILogger" as the type name.
Couple of ways we could go about fixing this:
- change the name of the Micrsoft.Teams.Common.Logging.Ilogger to something like
ITeamsLoggerwhich would have the added benefit of being a bit more explicit and self documenting. - have a further check within the inject method to ensure both types (property and the resolved type) really are the same type and if not throw an invalid operation exception as intended.
Additional notes:
The logger on the devtools plugin has an additional attribute of AllowNull though this isn't being read, the Dependency Attribute has an optional property, was this supposed to be used instead?
JadynWong
Metadata
Metadata
Assignees
Labels
No labels